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

ImageIcon in JTREE  RSS feed

 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to replace the default ImageIcon in a JTree with an icon that I have. Here's a sample of the code I use.
((DefaultTreeCellRenderer)jt.getCellRenderer()).setLeafIcon(
new ImageIcon("C:/Program Files/Java Web Start/JavaCup.ico")
);
But when I view the tree the Default Icon is missing but I don't see the JavaCup.ico. Does anyone have any suggestions on what I may be doing wrong?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!