List of usage examples for java.awt.dnd DragSource DefaultMoveNoDrop
Cursor DefaultMoveNoDrop
To view the source code for java.awt.dnd DragSource DefaultMoveNoDrop.
Click Source Link
From source file:TreeDragTest.java
public void dragGestureRecognized(DragGestureEvent dge) { TreePath path = sourceTree.getSelectionPath(); if ((path == null) || (path.getPathCount() <= 1)) { // We can't move the root node or an empty selection return;/*from w ww . ja va 2 s .c o m*/ } oldNode = (DefaultMutableTreeNode) path.getLastPathComponent(); transferable = new TransferableTreeNode(path); source.startDrag(dge, DragSource.DefaultMoveNoDrop, transferable, this); // If you support dropping the node anywhere, you should probably // start with a valid move cursor: //source.startDrag(dge, DragSource.DefaultMoveDrop, transferable, // this); }