wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Tree Cell Renderer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Tree Cell Renderer" Watch "Tree Cell Renderer" New topic
Author

Tree Cell Renderer

Aabha Varma
Greenhorn

Joined: Jan 12, 2005
Posts: 22
I have a tree with two levels.

Parent node contains the information, depending on which child nodes colour should change.

Is it possible that when i am rendering the parent (by checking the node level) can i render the child nodes...as i have the info.

Can anyone help me out.

Regards,
Manuel Moons
Ranch Hand

Joined: Mar 05, 2002
Posts: 229
What do you mean exactly? Why do you want to render the children when rendering the parent?
Swati Udas
Ranch Hand

Joined: Aug 18, 2004
Posts: 121
As per my understanding :-
The renderer will check for each tree node when the tree is to be displayed. Depanding on your code it will check the information for that node and display accordingly. SO the renderer will go to all leaf nodes as well as parent nodes.
U can write appropriate code by checking nodelevel and using node.getParent for checking the parent properties.

Setting the display properties for child nodes while displaying the parent doesnt make sense atleast as long as u r following the Renderer way.


SCJP 1.4 (90%)<br />SCWCD 1.4 (88%)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tree Cell Renderer
 
Similar Threads
Sorting JTree Nodes alphabetically
JTree: How to update nodes?
listening to events when Child node changes?
Using Custom Tree Cell rendering
Showing PLUS sign(tree expansion) even if child is not present