Skip to content
Snippets Groups Projects
StartSceneController.java 664 B
Newer Older
package org.example.StartScreen;

import javafx.event.ActionEvent;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

import java.io.IOException;

public class StartSceneController {

    private Stage stage;
    private Scene scene;
    private Parent root;

    public void switchToOptions(ActionEvent event) throws IOException {
        root = FXMLLoader.load(getClass().getResource("/fxml/start.fxml"));
        stage = (Stage)((Node)event.getSource()).getScene().getWindow();
        scene = new Scene(root);
        stage.setScene(scene);
        stage.show();
    }
}