Example usage for java.awt.dnd DragSource DefaultMoveNoDrop

List of usage examples for java.awt.dnd DragSource DefaultMoveNoDrop

Introduction

In this page you can find the example usage for java.awt.dnd DragSource DefaultMoveNoDrop.

Prototype

Cursor DefaultMoveNoDrop

To view the source code for java.awt.dnd DragSource DefaultMoveNoDrop.

Click Source Link

Document

The default Cursor to use with a move operation indicating that a drop is currently not allowed.

Usage

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);
}