Refactor JavaFX UserFiles
This commit is contained in:
parent
985556b3f2
commit
dcfcc91090
|
@ -298,13 +298,9 @@ public class UserFiles {
|
||||||
|
|
||||||
public <T> T runAndWait(Callable<T> c) {
|
public <T> T runAndWait(Callable<T> c) {
|
||||||
try {
|
try {
|
||||||
// initialize JavaFX
|
|
||||||
new javafx.embed.swing.JFXPanel();
|
|
||||||
javafx.application.Platform.setImplicitExit(false);
|
|
||||||
|
|
||||||
// run on FX Thread
|
// run on FX Thread
|
||||||
FutureTask<T> task = new FutureTask<T>(c);
|
FutureTask<T> task = new FutureTask<T>(c);
|
||||||
javafx.application.Platform.runLater(task);
|
invokeJavaFX(task);
|
||||||
return task.get();
|
return task.get();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
|
@ -136,9 +136,7 @@ public class MainFrame extends JFrame {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
installAction(this.getRootPane(), getKeyStroke(VK_F1, 0), newAction("Help", evt -> {
|
installAction(this.getRootPane(), getKeyStroke(VK_F1, 0), newAction("Help", evt -> GettingStartedStage.start()));
|
||||||
GettingStartedStage.start();
|
|
||||||
}));
|
|
||||||
|
|
||||||
SwingEventBus.getInstance().register(this);
|
SwingEventBus.getInstance().register(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue