I have a login stage and then home stage, there are many actions I want to do for each user, so I want the userID for the current user. How do I parse the Id or the username from login stage to home stage ? Note that there is a public database connected and when the user enter his username and password, the system will check if the data are true and exist in the database. This is my login stage controller after checking the entered data:
Stage HomeScreen = new Stage();
Parent root=null;
try {
root=FXMLLoader.load(getClass().getResource("Home.fxml"));
}
catch (IOException ex) {
Logger.getLogger(LoginScreen.class.getName()).log(Level.SEVERE, null, ex);
}
Stage current =
(Stage)username.getScene().getWindow();
Scene scene = new Scene(root);
HomeScreen.setScene(scene);
HomeScreen.initStyle(StageStyle.DECORATED);
HomeScreen.setTitle("Network Automation");
current.hide();
HomeScreen.show();