JavaFX working with threads and GUI

前端 未结 2 697
予麋鹿
予麋鹿 2020-12-02 21:58

I have a problem while working with JavaFX and Threads. Basically I have two options: working with Tasks or Platform.runLater. As I understand

2条回答
  •  广开言路
    2020-12-02 22:18

    Use a Worker (Task, Service) from the JavaFX Application thread if you want to do something in the background.

    http://docs.oracle.com/javafx/2/api/javafx/concurrent/package-summary.html

    Use Platform.runLater from a background thread if you want to do something on the JavaFX Application thread.

    http://docs.oracle.com/javafx/2/api/javafx/application/Platform.html#runLater%28java.lang.Runnable%29

提交回复
热议问题