Screen navigation (JavaFX) [closed]

0

I have a calendar program and on the main screen I have the option of Add Contact. When it is clicked a new screen is opened so that you can enter the data. When the Save button on this second screen is activated, it saves the data correctly and closes that second stage. However, the main screen client list is not updated automatically when this happens, I need to click on an Update button. How do I call the update method from this first screen and refresh it through the second one?

    
asked by anonymous 08.08.2018 / 00:14

1 answer

1

When you are creating the second stage, set the setOnCloseRequest method, as below, by placing a method that loads the data into the contact table. When the second stage is terminated this method will be called.

segundoStage.setOnCloseRequest(event  -> {
    carregarDadosTabela();
});
    
08.08.2018 / 17:40