JDK-8089524 : IllegalStateException using JFXPanel in a netbeans window.
  • Type: Bug
  • Component: javafx
  • Sub-Component: swing
  • Affected Version: 7u15
  • Priority: P3
  • Status: Closed
  • Resolution: Incomplete
  • Submitted: 2013-04-22
  • Updated: 2018-09-06
  • Resolved: 2017-08-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Relates :  
Description
Docking and undocking a Netbeans Platform window, with an embedded JFXPanel results in the below exception. All of the lines in the stack trace indicate oracle code, not sure what I can do different to prevent the error. 

Exception in runnable
java.lang.IllegalStateException: Not on FX application thread; currentThread = JavaFX Application Thread
	at com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:237)
	at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(QuantumToolkit.java:397)
	at javafx.stage.Window.setShowing(Window.java:780)
	at javafx.stage.Window.show(Window.java:796)
	at com.sun.javafx.stage.EmbeddedWindow.show(EmbeddedWindow.java:57)
	at javafx.embed.swing.JFXPanel$7.run(JFXPanel.java:678)
	at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
	at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)

Comments
No steps given to reproduce this issue in netbeans. Moreover, a solution has been given and no response/feedback is received after that.
30-08-2017

Looks like JFXPanel is disposed on docking which leads to platform exit which then leads to reinitialization which goes wrong (look at the top frame of the stack). Please, try setting the following: Platform.setImplicitExit(false); This will prevent FX from auto-exiting on last (embedded) window disposal. However, in this case Platform.exit() should be called explicitly when necessary.
12-07-2013