• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamically deciding the style of a node in tree control  RSS feed

 
naveen kollepara
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using JTree class to develop a tree control.
This tree should be dynamically changind depending on user actions.
I want to dynamically control the style(icons of folders,leaf nodes) of nodes being added to the tree. How will i be able to do this?
I have seen that we can set the style of nodes by using DefaultTreeCellRenderer class.But this is setting the style for whole tree, but i want to decide the style of each node in the tree.
It would be very helpful if someone answers this question.
Thanks,
Naveen.
 
Sajee Joseph
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Naveen,
Checkout the topic named 'JTRee-setting color for specific nodes in the tree'. This provides a link to an example. I hope the example will help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!