Created
May 28, 2022 19:22
-
-
Save ennerf/5e6a6aea6145307143da8598b5ef4c51 to your computer and use it in GitHub Desktop.
RootViewController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RootViewController implements Initializable { | |
@FXML | |
Pane root; | |
@FXML | |
Pane view1; | |
@FXML | |
Pane view2; | |
@FXML | |
ViewController view1Controller; | |
@FXML | |
ViewController view2Controller; | |
@Override | |
public void initialize(URL location, ResourceBundle resources) { | |
view1Controller.button.setOnAction(e -> root.getChildren().setAll(view2)); | |
view2Controller.button.setOnAction(e -> root.getChildren().setAll(view1)); | |
root.getChildren().setAll(view1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment