I am trying to update the label in my JavaFx GUI asynchronously with various status message for the application.
For e.g.
A button 'update' in my Application call a method updateSettings() in the controller. Now I am try to update the label on the UI in the following manner.
@FXML
private void updateSettings() {
label.text("message1");
//some action
lable.text("action done");
label.text("calling method.. wait for some time")
// call to time consuming method - timeConsumingMethod();
label.text
label.text("operation completely successfully");
}
private void timeConsumingMethod() {
label.text("message2");
//some actions
label.text("message3");
//more time consuming actions
label.text("time consuming method is done with success");
}
I want that these messages should be displayed in the label while the flow is getting executed, to show user about the various activities going on in the application.
How to achieve this behavior ?