aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Identify the path of the node and insert in JTree. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Identify the path of the node and insert in JTree." Watch "Identify the path of the node and insert in JTree." New topic
Author

Identify the path of the node and insert in JTree.

Melki Joe
Greenhorn

Joined: Aug 29, 2008
Posts: 24
I am having two trees and I want to get the node from one tree and insert it into another tree. While inserting if the source node has more parents how to identify the path of the node and insert into the appropriate node in the destination tree.

Kindly help me in this issue.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

How do you want to indicate what node to copy and where to move it to? What does "more parents" mean? That the node is more than 1 layer deep in the tree? Why does this matter? Are you trying to copy the node itself or the node and the path to it? Or do you need to insert the node at the same level in the new location?


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Melki Joe
Greenhorn

Joined: Aug 29, 2008
Posts: 24
I need to insert the node at the same level in the new location.

Here I am giving the structure for more parents.

A
-1
--2
---leaf1
---leaf2
B
-1
--2
---leaf1
---leaf2
---leaf3

I want to transfer the leaf nodes as if the left tree to the right tree.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Identify the path of the node and insert in JTree.