0

Do i need to create a new Runnable object and run Platform.runLater if i'm still working on JavaFX Application Thread for updating UI. For example, i need to update a Text object which is imported in Controller Class from a fxml file, and i will call a static method from another class to do this. Moreover, the imported Text object is static, so is it safe to call static object like;

ControllerClass.textLabel.setText("foobar");

or even if i'm working on JavaFX Application Thread, should using Platform.runLater will be more safe for updating UI ?

quartaela
  • 2,579
  • 16
  • 63
  • 99

1 Answers1

2

No.

You do not need to use Platform.runLater if you are already in the JavaFX application thread.

jewelsea
  • 150,031
  • 14
  • 366
  • 406