Skip to content

Instantly share code, notes, and snippets.

@ennerf
Created May 28, 2022 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ennerf/5e6a6aea6145307143da8598b5ef4c51 to your computer and use it in GitHub Desktop.
Save ennerf/5e6a6aea6145307143da8598b5ef4c51 to your computer and use it in GitHub Desktop.
RootViewController
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