FileDocCategorySizeDatePackage
TreeDragTest.javaAPI DocExample2208Thu Oct 24 20:14:28 BST 2002None

TreeDragTest

public class TreeDragTest extends JFrame

Fields Summary
TreeDragSource
ds
TreeDropTarget
dt
JTree
tree
Constructors Summary
public TreeDragTest()

    super("Rearrangeable Tree");
    setSize(300,200);
    setDefaultCloseOperation(EXIT_ON_CLOSE);

    // If you want autoscrolling, use this line:
    tree = new AutoScrollingJTree();
    // Otherwise, use this line:
    //tree = new JTree();
    getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);

    // If we only support move operations...
    //ds = new TreeDragSource(tree, DnDConstants.ACTION_MOVE);
    ds = new TreeDragSource(tree, DnDConstants.ACTION_COPY_OR_MOVE);
    dt = new TreeDropTarget(tree);
    setVisible(true);
  
Methods Summary
public static voidmain(java.lang.String[] args)

    new TreeDragTest();