In swing we have:
boolean SwingUtilities.isEventDispatchThread()
that returns true if it is called from swing event dispatch thread.
is there anything similar in javafx?
Yes you can check that you are in the FX thread with:
Platform.isFxApplicationThread();
Note that many UI interacting methods will throw an exception when called outside the FX thread.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With