-
Bug
-
Resolution: Fixed
-
P4
-
fx2.0
-
WinXPSP3, JavaFX2.0GA, JDK7u2b8
"NOTE: This method is not called on the JavaFX Application Thread. An application must not construct a Scene or a Stage in this method. An application may construct other JavaFX objects in this method."
However, some JavaFX controls can only be constructed on the JavaFX Application Thread.
Perhaps this is as designed, and only clarification of documentation as specified in
Sample test case:
import javafx.application.Application;
import javafx.scene.control.*;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class InitThreadTest extends Application {
public static void main(String[] args) { Application.launch(args); }
@Override public void init() throws Exception {
new Button();
try { new WebView(); } catch (Exception e) { e.printStackTrace(); }
try { new Tooltip(); } catch (Exception e) { e.printStackTrace(); }
try { new ContextMenu(); } catch (Exception e) { e.printStackTrace(); }
}
@Override public void start(Stage s) { System.exit(0); }
}
Output of code is =>
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 javafx.scene.Scene.<init>(Unknown Source)
at javafx.scene.Scene.<init>(Unknown Source)
at javafx.stage.PopupWindow.<init>(Unknown Source)
at javafx.scene.control.PopupControl.<init>(Unknown Source)
at javafx.scene.control.Tooltip.<init>(Unknown Source)
at InitThreadTest.init(InitThreadTest.java:11)
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 javafx.scene.Scene.<init>(Unknown Source)
at javafx.scene.Scene.<init>(Unknown Source)
at javafx.stage.PopupWindow.<init>(Unknown Source)
at javafx.scene.control.PopupControl.<init>(Unknown Source)
at javafx.scene.control.ContextMenu.<init>(Unknown Source)
at InitThreadTest.init(InitThreadTest.java:12)
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)
- blocks
-
JDK-8089903 Popup doc does not mention JavaFX usage thread for construction
- Open
- duplicates
-
JDK-8125337 Multi-threaded node creation leads to IllegalStateException
- Closed
-
JDK-8096753 Tooltip of Tab (and other controls) cannot be set of FXApplicationThread
- Closed
- relates to
-
JDK-8087718 WebView can only be created on the FX application thread
- Open
-
JDK-8097257 Additional app-thread checks should be added (back) after RT-17716
- Resolved
-
JDK-8094689 Unit test failure in Snapshot1Test after fix for RT-17716
- Resolved
-
JDK-8096398 [Layout] Ensemble8 ChoiceBox control starts out at smaller size
- Resolved
-
JDK-8096190 new HTMLEditor().getHtmlText() cannot be called outside of FX application thread
- Closed
-
JDK-8179676 Style property changed on other Thread
- Closed
-
JDK-8090669 Add tests that check for correct non-app thread initialization of Scene & PopupWindow
- Open
-
JDK-8097937 Relax restriction on creating Scene only on FX App thread
- Resolved