Menu

#3 Copy/Paste

open
nobody
None
5
2007-02-02
2007-02-02
krebu
No

From: http://www.cs.ualberta.ca/TechReports/2005/TR05-07/TR05-07.html
This will help a lode...

Provided that they're in the same JVM, and that they're built on DefaultMutableTreeNodes (and DefaultTreeModel), you can simply take the root DefaultMutableTreeNode of the first tree and add it to another JTtree. It will take its children with it.

root=tree.getModel().getRoot();

then use

targetNode = // get the target node you

need to use, maybe the getLastSelectedPathComponent();

targetNode.add(root);

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.