Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Different Icons for JTree

 
Pat Peg
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that i can generally replace idons in a jtree for leaves, open, closed etc. but can I have specific icons for specific nodes/leaves? In otherwords, is it possible that in a large tree each item could be graphically represented in a different way (not just the three basic ways that are given)? An example might be an athletic association where they would want to represent each team on the 'tree' by their mascot. If possible, how would you do this. Can this be set in the node or is it set in the tree?
 
Brian Cole
Author
Ranch Hand
Posts: 906
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is handled by the renderer.
 
Rob Spoor
Sheriff
Pie
Posts: 20533
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Cole:
It is handled by the renderer.

I'd modify the body just slightly:

Because you are now assuming behaviour (the return this part) that might someday change.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic