File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Tree Cell Renderer

Aabha Varma

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 i have the info.

Can anyone help me out.

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%)
I agree. Here's the link:
subject: Tree Cell Renderer
It's not a secret anymore!