This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTree

 
shiva shankar kn
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
I need to set different icons for different leafs in a tree. I request you to reply to my question.
 
Vikalp Setya
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You will have to write a Renderer for the tree. Override the getTreeCellRenderer method to return a JLabel and set the icon of the label returned. Refer to any tutorial on how to set and write a renderer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic