We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d1a4b2 commit e323a3cCopy full SHA for e323a3c
1 file changed
src/main/java/com/example/FxUtils.java
@@ -4,14 +4,15 @@
4
5
public class FxUtils {
6
7
- /**
8
- * Execute task on FX-thread if possible, otherwise inline.
9
- */
10
- static void runOnFx(Runnable task) {
+ public static void runOnFx(Runnable task) {
11
try {
12
- if (Platform.isFxApplicationThread()) task.run();
13
- else Platform.runLater(task);
+ if (Platform.isFxApplicationThread()) {
+ task.run();
+ } else {
+ Platform.runLater(task);
+ }
14
} catch (IllegalStateException notInitialized) {
15
+ //headless
16
task.run();
17
}
18
0 commit comments