Cannot see JFXPanels on modal JDialog
lehmann at media-interactive.de
Fri Aug 10 02:37:06 PDT 2012
Solved, another case of PEBCAK. I was showing the JDialog directly from
the FX application thread. SwingUtilities.invokeLater helped. Of course,
it would have been nice to be able to use a FX window in the first
place... but that does not take a JFrame as owner.
FWIW, here's the application thread stack trace waiting on the AWT treelock.
> "JavaFX Application Thread" prio=6 tid=0x0000000008dad000 nid=0x1a08 in Object.wait() [0x000000000cd0c000]
> java.lang.Thread.State: WAITING (on object monitor)
> at java.lang.Object.wait(Native Method)
> - waiting on <0x00000000f033ba28> (a java.awt.Component$AWTTreeLock)
> at java.lang.Object.wait(Object.java:485)
> at java.awt.Dialog.show(Unknown Source)
> - locked <0x00000000f033ba28> (a java.awt.Component$AWTTreeLock)
> at java.awt.Component.show(Unknown Source)
> at java.awt.Component.setVisible(Unknown Source)
On 10.08.2012 01:08, Werner Lehmann wrote:
> here is a strange problem with a JFXPanel, hopefully somebody has an idea...
> I have a JDialog with a JTree and two JFXPanels. Everything works fine
> if the dialog operates modeless. As soon as I make it modal, the fx
> panels are missing. It does not matter which type of modality I use.
> Already tried to reproduce it with a test application but that did work.
> Then I tried to add a sleep to give the fx panels some time to
> initialize (which is of course in Platform.runLater). No cigar. Being
> stumped now.
> works: new JDialog(someframe, false)
> does not work: new JDialog(someframe, true)
More information about the openjfx-dev