Navigation between screens (Javafx)

Asked

Viewed 194 times

0

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

  • Could you put snippets of code so the staff can help better?

1 answer

1

When you create 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 closed this method will be called.

segundoStage.setOnCloseRequest(event  -> {
    carregarDadosTabela();
});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.