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.