From 1b76ef109c23d37473fc496eea0f2f1a1f76d1db Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Sun, 22 May 2016 10:37:20 +0200 Subject: [PATCH] Now the app runs correctly --- .../es/kauron/estraba/controller/SplashController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/es/kauron/estraba/controller/SplashController.java b/src/main/java/es/kauron/estraba/controller/SplashController.java index 7673dac..b199931 100644 --- a/src/main/java/es/kauron/estraba/controller/SplashController.java +++ b/src/main/java/es/kauron/estraba/controller/SplashController.java @@ -30,6 +30,7 @@ import com.jfoenix.controls.JFXSnackbar; import com.jfoenix.controls.JFXSpinner; import es.kauron.estraba.App; import es.kauron.estraba.model.DataBundle; +import javafx.application.Platform; import javafx.concurrent.Task; import javafx.event.ActionEvent; import javafx.fxml.FXML; @@ -144,17 +145,17 @@ public class SplashController implements Initializable{ } }); - root.getScene().setOnDragOver(e -> { + Platform.runLater(() -> root.getScene().setOnDragOver(e -> { Dragboard db = e.getDragboard(); if (db.hasFiles()) { e.acceptTransferModes(TransferMode.COPY); } else { e.consume(); } - }); + })); // Dropping over surface - root.getScene().setOnDragDropped(e -> { + Platform.runLater(() -> root.getScene().setOnDragDropped(e -> { Dragboard db = e.getDragboard(); boolean success = false; if (db.hasFiles()) { @@ -167,7 +168,7 @@ public class SplashController implements Initializable{ } e.setDropCompleted(success); e.consume(); - }); + })); } private void errorLoading() {