From dcfcc91090d5bc6891d18a017a0176beeaac00d1 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 11 Aug 2016 03:54:27 +0800 Subject: [PATCH] Refactor JavaFX UserFiles --- source/net/filebot/UserFiles.java | 6 +----- source/net/filebot/ui/MainFrame.java | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/source/net/filebot/UserFiles.java b/source/net/filebot/UserFiles.java index 9f3decbe..29898d3f 100644 --- a/source/net/filebot/UserFiles.java +++ b/source/net/filebot/UserFiles.java @@ -298,13 +298,9 @@ public class UserFiles { public T runAndWait(Callable c) { try { - // initialize JavaFX - new javafx.embed.swing.JFXPanel(); - javafx.application.Platform.setImplicitExit(false); - // run on FX Thread FutureTask task = new FutureTask(c); - javafx.application.Platform.runLater(task); + invokeJavaFX(task); return task.get(); } catch (Exception e) { throw new RuntimeException(e); diff --git a/source/net/filebot/ui/MainFrame.java b/source/net/filebot/ui/MainFrame.java index fdbad107..fc7414b1 100644 --- a/source/net/filebot/ui/MainFrame.java +++ b/source/net/filebot/ui/MainFrame.java @@ -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); }