kauron/estraba
Archived
1
0
Fork 0

Now the app runs correctly

This commit is contained in:
Carlos Galindo 2016-05-22 10:37:20 +02:00
parent 1b832e2851
commit 1b76ef109c
Signed by: kauron
GPG key ID: 83E68706DEE119A3

View file

@ -30,6 +30,7 @@ import com.jfoenix.controls.JFXSnackbar;
import com.jfoenix.controls.JFXSpinner; import com.jfoenix.controls.JFXSpinner;
import es.kauron.estraba.App; import es.kauron.estraba.App;
import es.kauron.estraba.model.DataBundle; import es.kauron.estraba.model.DataBundle;
import javafx.application.Platform;
import javafx.concurrent.Task; import javafx.concurrent.Task;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.fxml.FXML; 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(); Dragboard db = e.getDragboard();
if (db.hasFiles()) { if (db.hasFiles()) {
e.acceptTransferModes(TransferMode.COPY); e.acceptTransferModes(TransferMode.COPY);
} else { } else {
e.consume(); e.consume();
} }
}); }));
// Dropping over surface // Dropping over surface
root.getScene().setOnDragDropped(e -> { Platform.runLater(() -> root.getScene().setOnDragDropped(e -> {
Dragboard db = e.getDragboard(); Dragboard db = e.getDragboard();
boolean success = false; boolean success = false;
if (db.hasFiles()) { if (db.hasFiles()) {
@ -167,7 +168,7 @@ public class SplashController implements Initializable{
} }
e.setDropCompleted(success); e.setDropCompleted(success);
e.consume(); e.consume();
}); }));
} }
private void errorLoading() { private void errorLoading() {