I'm working with JavaFx and Scenebuilder and want create a local app for myself called "Taskplanner" in eclipse.
I created a new Stage and set it with a Scene (see Main.java). But not sure how to set a new Scene in the old stage (see Controller.java). Didnt also not find out if it is possible pass the signInButtonClicked()-Methode the "Stage primaryStage" over Scene Builder
Can anybody help ?
Controller.java:
@FXML Button btnSignIn; @FXML public void signInButtonClicked() throws Exception { //Here I want call the new Scene(SignInGUI.fxml) in my old Stage FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("../view/SignInGUI.fxml")); }
Main.java:
@Override public void start(Stage primaryStage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("../view/LoginGUI.fxml")); primaryStage.setTitle("Taskplanner"); primaryStage.setScene(new Scene(root,500,500)); primaryStage.show(); } public static void main(String[] args) { launch(args); }