wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes How to create a tree model for three JTrees 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 "How to create a tree model for three JTrees" Watch "How to create a tree model for three JTrees" New topic

How to create a tree model for three JTrees

kiril simeonov

Joined: Dec 19, 2001
Posts: 4
HI, everybody
I work on an application which should implement three trees displaying differends conditions of a node.
In my case I have one main tree (containing parent and child nodes)and two other trees.Every node can have three conditions so if the node is in condition one I want to have it displayed in the main tree (in this tree remains the node always displayed) and in one of the other two trees (but only in one of them) ,if the node is in condition two - again in the main tree an in one of the other two trees.If no condition was set the node remains simply displayed in the main tree.
The point is keepeng all the three trees updated if any changes happen in one of them.
For example:
if I want to remove a child node from one parent (Group) to another in the main tree and the node is in let's say in condition one this have to happen in "tree one" too.
Can anybody tell me how to procede in this case.
I thank you in advance
three simeonov@gmx.net
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Kiril,
I would probably create one TreeModel for the first tree and then have the other Trees added as listeners to the first and update themselves depending on what happens to the main model.
I agree. Here's the link: http://aspose.com/file-tools
subject: How to create a tree model for three JTrees
Similar Threads
Help me out to devise an algorithm for this
Algorithm to find Nodes having largest distance in Binary tree.
Tree problem
Tree structure retrieval from Database
Difference root element/root node