Example usage for javafx.scene.input DragEvent DRAG_EXITED

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

Introduction

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

Prototype

EventType DRAG_EXITED

To view the source code for javafx.scene.input DragEvent DRAG_EXITED.

Click Source Link

Document

This event occurs when drag gesture exits a node.

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Group root = new Group();
    Scene scene = new Scene(root, 300, 250);

    TextField textBox = new TextField();
    textBox.setPromptText("Write here");

    // Define an event handler
    EventHandler handler = new EventHandler<InputEvent>() {
        public void handle(InputEvent event) {
            System.out.println("Handling event " + event.getEventType());
            event.consume();/*from www.  jav a2 s . c o m*/
        }
    };
    scene.addEventHandler(DragEvent.DRAG_EXITED, handler);

    scene.addEventHandler(MouseEvent.MOUSE_DRAGGED, handler);

    root.getChildren().add(textBox);
    primaryStage.setScene(scene);
    primaryStage.show();
}