I would like to access my Main Stage from outside. My mainstage is loaded with a fxml. After that I can press a login button on the mainstage and then a login popup opens. I want to set the button to Visi... as long as the login window is open. and then set it to Visi... afterwards. Furthermore I want to show several elements in the mainstage after my login was successful.
@Override
public void start(Stage primaryStage) throws Exception
{
Parent root = FXMLLoader.load(getClass().getResource("../resource/views/lobbyMain.fxml"));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 1000, 700));
primaryStage.show();
primaryStage.setOnCloseRequest(windowEvent -> {
Platform.exit();
if (loginStage != null){
loginStage.close();
}
if (registrationStage != null){
registrationStage.close();
}
});
}
I hope you can help me in this regard. Thank you very much.