Class FxPlatformUtil

java.lang.Object
privbot.ui.fx.FxPlatformUtil

public final class FxPlatformUtil extends Object
Cross-thread helpers for JavaFX embedded in Swing (e.g. studio windows).
  • Method Details

    • configureImplicitExitOnce

      public static void configureImplicitExitOnce()
      Same lifecycle hook as AutoCombatProUI: keep the FX toolkit alive while Swing windows may be hidden. Call before the first JFXPanel for a process.
    • primeEmbeddedFxToolkitOnEdt

      public static void primeEmbeddedFxToolkitOnEdt()
      Starts the embedded JavaFX toolkit so javafx.scene.control types (e.g. Spinner) can be constructed on the Swing EDT before any JFXPanel.setScene(javafx.scene.Scene) call.

      If this is skipped, some runtimes throw NoClassDefFoundError: Could not initialize class javafx.scene.control.Spinner when those controls are instantiated too early.

      Must run on the Swing EDT. Safe to call multiple times.

    • runOnFxAndWait

      public static void runOnFxAndWait(Runnable r)
      Runs r on the FX application thread and blocks the caller until completion. Use from the EDT when reading or mutating JavaFX controls during save/load.