Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to set different Icon for each TreeNode  RSS feed

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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!