I currently use this code to change scenes in my JFX program:
public void addTaskFunction (ActionEvent event) throws IOException{
Parent addTaskParent = FXMLLoader.load(getClass().getResource("/LogIn/AddDataToTaskManager.fxml"));
Scene addTaskScene = new Scene(addTaskParent);
Stage appStage = (Stage) ((Node) event.getSource()).getScene().getWindow();
appStage.setScene(addTaskScene);
appStage.setResizable(true);
appStage.show();
}
Using this code closes the previous stage and opens a new one on top. How can I make it so the previous stage does not close and this AddDataToTaskMaager.fxml opens on top of TaskManager.fxml
Thank you