Javafx Updating UI from a Thread without direct calling Platform.runLater

后端 未结 2 578

Nowadays some says it is not suitable to use Platform.runLater() for updating the UI from a non-JavaFX Thread and Oracle site introduce a way with bindings for

2条回答
  •  抹茶落季
    2021-01-14 00:25

    As updateMessage() on a Task finally uses Platform.runLater() to update the messageProperty, it is no alternative to a direct runLater() in your code. So the essence is:

    JavaFX is not multithreaded, any Porperty binding will only work if the property is modified in the JavaFX thread, e.g. by using Platform.runLater().

提交回复
热议问题