LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Java: JTree & drag'n'drop (https://www.linuxquestions.org/questions/programming-9/java-jtree-and-dragndrop-189944/)

decadent 06-05-2004 05:36 AM

Java: JTree & drag'n'drop
 
Code:

DefaultMutableTreeNode dmtn = new DefaultMutableTreeNode("root");

DefaultMutableTreeNode child = new DefaultMutableTreeNode("leaf1");
dmtn.add(child);

child = new DefaultMutableTreeNode("leaf2");
dmtn.add(child);

child = new DefaultMutableTreeNode("leaf3");
dmtn.add(child);

mymodel = new DefaultTreeModel(dmtn);
mytree = new JTree(mymodel);

How to realize drag'n'drop for tree leafs?
Please, write code, if it is not difficult for you.

aaa 06-07-2004 06:41 AM

This book has an example of what you want.


All times are GMT -5. The time now is 10:28 AM.