See RT-17716 for a description and test case. If an app constructs a WebView node in its init() method, which is not run on the FX app thread, it will throw the following exception:
java.lang.IllegalStateException: Not on FX application thread; currentThread = JavaFX-Launcher
at com.sun.javafx.tk.Toolkit.checkFxUserThread(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(Unknown Source)
at com.sun.webpane.sg.prism.InvokerImpl.checkEventThread(Unknown Source)
at com.sun.webpane.platform.WebPage.<init>(Unknown Source)
at com.sun.webpane.sg.ImplementationManager.createPage(Unknown Source)
at com.sun.webpane.sg.ImplementationManager.createPage(Unknown Source)
at javafx.scene.web.WebEngine.<init>(Unknown Source)
at javafx.scene.web.WebEngine.<init>(Unknown Source)
at javafx.scene.web.WebView.<init>(Unknown Source)
at InitThreadTest.init(InitThreadTest.java:10)
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source)
at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:722)
java.lang.IllegalStateException: Not on FX application thread; currentThread = JavaFX-Launcher
at com.sun.javafx.tk.Toolkit.checkFxUserThread(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(Unknown Source)
at com.sun.webpane.sg.prism.InvokerImpl.checkEventThread(Unknown Source)
at com.sun.webpane.platform.WebPage.<init>(Unknown Source)
at com.sun.webpane.sg.ImplementationManager.createPage(Unknown Source)
at com.sun.webpane.sg.ImplementationManager.createPage(Unknown Source)
at javafx.scene.web.WebEngine.<init>(Unknown Source)
at javafx.scene.web.WebEngine.<init>(Unknown Source)
at javafx.scene.web.WebView.<init>(Unknown Source)
at InitThreadTest.init(InitThreadTest.java:10)
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source)
at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:722)
- duplicates
-
JDK-8096190 new HTMLEditor().getHtmlText() cannot be called outside of FX application thread
- Closed
- relates to
-
JDK-8093856 Some controls can only be created on the FX application thread
- Resolved
-
JDK-8096190 new HTMLEditor().getHtmlText() cannot be called outside of FX application thread
- Closed