File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
Author

How to create a tree model for three JTrees

kiril simeonov
Greenhorn

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.
Regards,
Manfred.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to create a tree model for three JTrees