When showing the popup of a ComboBox contained in a JFXPanel, the following exception occurs. This issue has been introduced in b87 or b88 (not reproducible in b86). The popup is displayed but it doesnt work and it is impossible to dismiss it.
java.lang.ClassCastException: com.sun.javafx.tk.quantum.EmbeddedStage cannot be cast to com.sun.javafx.tk.quantum.WindowStage
at com.sun.javafx.tk.quantum.WindowStage.setVisible(WindowStage.java:386)
at javafx.stage.Window$9.invalidated(Window.java:789)
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:107)
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:141)
at javafx.stage.Window.setShowing(Window.java:827)
at javafx.stage.Window.hide(Window.java:852)
at javafx.stage.PopupWindow.hide(PopupWindow.java:416)
at javafx.stage.PopupWindow.doAutoHide(PopupWindow.java:581)
at javafx.stage.PopupWindow$PopupEventRedirector.handleMousePressedEvent(PopupWindow.java:805)
at javafx.stage.PopupWindow$PopupEventRedirector.handleRedirectedEvent(PopupWindow.java:747)
at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:106)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
at com.sun.javafx.event.EventRedirector.redirectEvent(EventRedirector.java:124)
at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:103)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:202)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3597)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3428)
at javafx.scene.Scene$MouseHandler.access$1800(Scene.java:3380)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1661)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2448)
at com.sun.javafx.tk.quantum.EmbeddedScene$2$1.run(EmbeddedScene.java:218)
at com.sun.javafx.tk.quantum.EmbeddedScene$2$1.run(EmbeddedScene.java:206)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.EmbeddedScene$2.run(EmbeddedScene.java:206)
at com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:224)
at com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:221)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:94)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:101)
at java.lang.Thread.run(Thread.java:724)
The cast occurs in the following code:
if (owner != null) {
WindowStage ownerStage = (WindowStage)owner;
ownerStage.requestToFront();
}
java.lang.ClassCastException: com.sun.javafx.tk.quantum.EmbeddedStage cannot be cast to com.sun.javafx.tk.quantum.WindowStage
at com.sun.javafx.tk.quantum.WindowStage.setVisible(WindowStage.java:386)
at javafx.stage.Window$9.invalidated(Window.java:789)
at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:107)
at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:141)
at javafx.stage.Window.setShowing(Window.java:827)
at javafx.stage.Window.hide(Window.java:852)
at javafx.stage.PopupWindow.hide(PopupWindow.java:416)
at javafx.stage.PopupWindow.doAutoHide(PopupWindow.java:581)
at javafx.stage.PopupWindow$PopupEventRedirector.handleMousePressedEvent(PopupWindow.java:805)
at javafx.stage.PopupWindow$PopupEventRedirector.handleRedirectedEvent(PopupWindow.java:747)
at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:106)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
at com.sun.javafx.event.EventRedirector.redirectEvent(EventRedirector.java:124)
at com.sun.javafx.event.EventRedirector.dispatchCapturingEvent(EventRedirector.java:103)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchCapturingEvent(CompositeEventDispatcher.java:43)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:52)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:202)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3597)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3428)
at javafx.scene.Scene$MouseHandler.access$1800(Scene.java:3380)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1661)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2448)
at com.sun.javafx.tk.quantum.EmbeddedScene$2$1.run(EmbeddedScene.java:218)
at com.sun.javafx.tk.quantum.EmbeddedScene$2$1.run(EmbeddedScene.java:206)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.EmbeddedScene$2.run(EmbeddedScene.java:206)
at com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:224)
at com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:221)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:94)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:101)
at java.lang.Thread.run(Thread.java:724)
The cast occurs in the following code:
if (owner != null) {
WindowStage ownerStage = (WindowStage)owner;
ownerStage.requestToFront();
}
- duplicates
-
JDK-8117833 Quantum: Class cast exception in WindowState.setVisible() when Swing or SWT is embedded
-
- Resolved
-