Summary
Initializing the JavaFX runtime via Platform.startup and then launching an Application on the JavaFX Application should throw IllegalStateException.
Problem
The current behavior causes a deadlock, instead of a reasonable Exception.
Solution
Application.launch will now throw an IllegalStateException, when it's called from the JavaFX Application Thread.
Specification
In the javafx.application.Application
class, add the following to the API docs of these two methods:
void launch(Class<? extends Application> appClass)
void launch(Class<? extends Application> appClass, String... args)
* @throws IllegalStateException if this method is called from the JavaFX application thread.
- csr of
-
JDK-8263322 Calling Application.launch on FX thread should throw IllegalStateException, but causes deadlock
- Resolved