Example usage for javafx.scene.input DragEvent DRAG_ENTERED

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

Introduction

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

Prototype

EventType DRAG_ENTERED

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

Click Source Link

Document

This event occurs when drag gesture enters 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");

    // Register an event handler for a single node and a specific event type
    scene.addEventHandler(DragEvent.DRAG_ENTERED, new EventHandler<DragEvent>() {
        public void handle(DragEvent e) {
            System.out.println("drag enter");
        }/*  w  w  w .  j ava 2 s  . c  o  m*/
    });

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