Example usage for javafx.scene.input DragEvent consume

List of usage examples for javafx.scene.input DragEvent consume

Introduction

In this page you can find the example usage for javafx.scene.input DragEvent consume.

Prototype

public void consume() 

Source Link

Document

Marks this Event as consumed.

Usage

From source file:org.ykc.usbcx.MainWindowController.java

@FXML
void openOnDragDrop(DragEvent event) {
    Dragboard db = event.getDragboard();
    boolean success = false;
    if (db.hasFiles()) {

        String filePath = null;//  w w w  .j a  v  a2  s  .co  m
        for (File file : db.getFiles()) {
            if (Utils.getFileExtension(file).equals("ucx1")) {
                success = true;
                partFileList = OpenRecord.open(file, usbcontrol, statusBar);
                loadRecord();
                break;
            }
        }
    }
    event.setDropCompleted(success);
    event.consume();
}