Check if JavaFX Platform is running

Viewed 1179

There is no method such as javafx.application.Platform.isRunning().

Can I check somehow else if the platform has been started?

I would like to modify my javafx.util.concurrent.Task classes to call updateMessage(), etc. only if the Platform is actually running.

That would be useful in a test setup.

If I test, I run into java.lang.IllegalStateException: Toolkit not initialized

I think this could be easily avoided by something like

if(Platform.isRunning()){
    updateMessage("Doing work");
}
0 Answers
Related