Refactor JavaFX UserFiles

This commit is contained in:
Reinhard Pointner 2016-08-11 03:54:27 +08:00
parent 985556b3f2
commit dcfcc91090
2 changed files with 2 additions and 8 deletions

View File

@ -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);

View File

@ -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);
}