Multithreading in JavaFX hangs the UI
Task
implements Runnable
, so when you call handler.run();
you actually run the call
method in the UI Thread. That will hang the UI.
You should start the task in a background thread, either via an executor or simply by calling new Thread(handler).start();
.
This is explained (maybe not very clearly) in the javadoc or in the JavaFX concurrency tutorial.