Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to set different Icon for each TreeNode

Rachel Mood
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using TreeTable implementation where i want to have different ImageIcon for each TreeNode.
But couldn't find any method where i can change particular treenode Icon.
If i use something like this:

TreeCellRenderer aTreeCellRenderer=mTreeTable.getTree().getCellRenderer();
DefaultTreeCellRenderer tcr = (DefaultTreeCellRenderer) aTreeCellRenderer;
ImageIcon leafImageIcon =new ImageIcon(aVehicle.getImagePath());

It applies changes for all the leafnodes.
Can someone please suggest me how to do it.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic