public final class FXUtils
extends java.lang.Object
| Constructor and Description |
|---|
FXUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertJavaFxThread() |
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.
|
static void |
runAndWait(java.lang.Runnable function)
Invokes a Runnable in JFX Thread and waits while it's finished.
|
static <R> R |
runAndWait(java.util.function.Supplier<R> function)
Invokes a Runnable in JFX Thread and waits while it's finished.
|
static <T,R> R |
runAndWait(T argument,
java.util.function.Function<T,R> function)
Invokes a Runnable in JFX Thread and waits while it's finished.
|
static void |
runFX(java.lang.Runnable run) |
public static void assertJavaFxThread()
public static void keepJavaFxAlive()
public static void runAndWait(java.lang.Runnable function)
throws java.lang.Exception
function - Runnable function that should be executed within the JavaFX threadjava.lang.Exception - if a exception is occurred in the run method of the Runnablepublic static <R> R runAndWait(java.util.function.Supplier<R> function)
throws java.lang.Exception
R - generic for return typefunction - Supplier function that should be executed within the JavaFX threadjava.lang.Exception - if a exception is occurred in the run method of the Runnablepublic static <T,R> R runAndWait(T argument,
java.util.function.Function<T,R> function)
throws java.lang.Exception
T - generic for argument typeR - generic for return typeargument - function argumentfunction - transform function that should be executed within the JavaFX threadjava.lang.Exception - if a exception is occurred in the run method of the Runnablepublic static void runFX(java.lang.Runnable run)