Update JavaFX in JFXPanel while EDT is blocked
richard.bair at oracle.com
Fri Jun 15 12:44:33 PDT 2012
Ya, there isn't a way to do this (because the drawing of the JFXPanel is actually in the Swing EDT). Further, we're looking at ways to combine the Swing EDT & FX Thread (the current idea is to have Swing use the FX thread as the EDT, rather than trying to get the FX thread to use the Swing EDT, but its a long story), so in the future you might actually not have two GUI toolkit threads at all (the upside of which would be no more SwingUtilities.invokeLater / Platform.runLater calls).
Either show the JavaFX stage separate from the JFXPanel, such that it really is in its own thread, or break up the Swing init to occur over multiple events or force rendering at certain points. Probably showing JavaFX in its own stage is the best approach?
On Jun 15, 2012, at 12:32 PM, Werner Lehmann wrote:
> is there a way to force a JFXPanel to update itself while the EDT is blocked?
> This is my situation: on startup the Swing application shows a login screen with a progress bar. This login screen is a JFXPanel and the progress bar is a JavaFX control. In the background lots of initializations are going on, and much of this should run on the EDT. Therefore it is executing within SwingUtilties.invokeAndWait - but that also seems to block updates to the JFXPanel and the progressbar is not updated.
> Maybe I can force an immediate repaint of the progressbar only? After all, I am running two GUI toolkits at the same time, both with their own GUI threads, so I'd like to take advantage of that...
More information about the openjfx-dev