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