This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Adding tree node to same root ..? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Adding tree node to same root ..?" Watch "Adding tree node to same root ..?" New topic

Adding tree node to same root ..?

prabhu pandurangan
Ranch Hand

Joined: May 23, 2008
Posts: 120
Hi Members,

Im having a JTree in left side and i have to make a dynamic tree on right side by adding it from the left tree.

For example:
When i add a child node from a root node it should be in the same structure for the right tree also.
Here the name of child node may be same for several root nodes, but it should check for its parent node key_id or anything else.....

Please help me in this..

If you are not clear with me Please let me know...

G Estes
Ranch Hand

Joined: Oct 22, 2002
Posts: 62
It sounds to me like you just need a listener added to the first tree. When a node is added, add a similar node to the second.

What am I missing here?
I agree. Here's the link:
subject: Adding tree node to same root ..?
Similar Threads
Tree Graph generation java
deletion of Node in JTree
Sorting JTree Nodes alphabetically
Problem with label
How to add child node on right click of a node to a JTree