JavaFX: Changing cursor during drag and drop
drag-and-drop, javafx-2, mouse-cursor
Solution
Try
((Node) mouseEvent.getSource()).setCursor(Cursor.HAND);
If doesn't work post your full code of class which includes your DragDetectedEventHandler.
Problem
I'm trying to change the cursor on my Node during a drag and drop, but the image is not changing. I'm calling `setCursor()` in the `DragDetectedEventHandler` of my node. I've also tried calling `getParent().setCursor()` and had the same result. I've also tried doing this in the other various event handler such as mouse down and drag over. At best, I get the image to change after the mouse button is release, but I need the image to be different during the drag. Anyone know how to do this? ``` private class DragDetectedEventHandler implements EventHandler<MouseEvent> { @Override public void handle(MouseEvent mouseEvent) { System.out.println("Drag Detected"); Dragboard db = startDragAndDrop(TransferMode.MOVE); ClipboardContent content = new ClipboardContent(); content.putString("sample-drag-text"); db.setContent(content); setCursor(_imageCursor); mouseEvent.consume(); } } ```