Package de.gsi.chart.utils
Class FXUtils
- java.lang.Object
-
- de.gsi.chart.utils.FXUtils
-
public final class FXUtils extends java.lang.ObjectSmall tool to execute/call JavaFX GUI-related code from potentially non-JavaFX thread (equivalent to old: SwingUtilities.invokeLater(...) ... invokeAndWait(...) tools)- Author:
- rstein
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidkeepJavaFxAlive()If you run into any situation where all of your scenes end, the thread managing all of this will just peter out.static voidrunAndWait(java.lang.Runnable run)Invokes a Runnable in JFX Thread and waits while it's finished.static voidrunFX(java.lang.Runnable run)static voidrunLater(java.lang.Runnable run)
-
-
-
Method Detail
-
keepJavaFxAlive
public static void keepJavaFxAlive()
If you run into any situation where all of your scenes end, the thread managing all of this will just peter out. To prevent this from happening, add this line:
-
runLater
public static void runLater(java.lang.Runnable run) throws java.util.concurrent.ExecutionException- Throws:
java.util.concurrent.ExecutionException
-
runFX
public static void runFX(java.lang.Runnable run)
-
runAndWait
public static void runAndWait(java.lang.Runnable run) throws java.lang.InterruptedException, java.util.concurrent.ExecutionExceptionInvokes a Runnable in JFX Thread and waits while it's finished. Like SwingUtilities.invokeAndWait does for EDT.- Parameters:
run- The Runnable that has to be called on JFX thread.- Throws:
java.lang.InterruptedException- if the execution is interrupted.java.util.concurrent.ExecutionException- if a exception is occurred in the run method of the Runnable
-
-