Skip to main content

The JavaFX Application Thread, UI Thread Restrictions and Platform.runLater

Learn The JavaFX Application Thread, UI Thread Restrictions and Platform.runLater (Phase 10 · Concurrency and Background Tasks (Essential), JavaFX) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

The JavaFX Application Thread • All live scene graph changes and event handlers run on one thread , the JavaFX Application Thread (FX thread). Blocking it (sleep, JDBC, HTTP, big loops) freezes the entire UI . Touching a live node from another thread throws IllegalStateException: Not on FX application thread . Rule : do long work on background threads , then hand results back to the FX thread. Platform.isFxApplicationThread() checks the current thread.

More lessons in Phase 10 · Concurrency and Background Tasks (Essential)