Class FxPlatformUtil
java.lang.Object
privbot.ui.fx.FxPlatformUtil
Cross-thread helpers for JavaFX embedded in Swing (e.g. studio windows).
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidSame lifecycle hook asAutoCombatProUI: keep the FX toolkit alive while Swing windows may be hidden.static voidStarts the embedded JavaFX toolkit sojavafx.scene.controltypes (e.g.static voidRunsron the FX application thread and blocks the caller until completion.
-
Method Details
-
configureImplicitExitOnce
public static void configureImplicitExitOnce()Same lifecycle hook asAutoCombatProUI: keep the FX toolkit alive while Swing windows may be hidden. Call before the firstJFXPanelfor a process. -
primeEmbeddedFxToolkitOnEdt
public static void primeEmbeddedFxToolkitOnEdt()Starts the embedded JavaFX toolkit sojavafx.scene.controltypes (e.g.Spinner) can be constructed on the Swing EDT before anyJFXPanel.setScene(javafx.scene.Scene)call.If this is skipped, some runtimes throw
NoClassDefFoundError: Could not initialize class javafx.scene.control.Spinnerwhen those controls are instantiated too early.Must run on the Swing EDT. Safe to call multiple times.
-
runOnFxAndWait
Runsron the FX application thread and blocks the caller until completion. Use from the EDT when reading or mutating JavaFX controls during save/load.
-