This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTree Root Icon

 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Christian Schlichtherle's True Zip classes to write a small file compression program. His classes allow for the visualisation of the contents of an archive in JTree form. I use this to allow the user to preview the contents before they decide to unzip the archive.

What I want to do to further enhance the preview JTree is have only the root icon as a Zip icon and the rest of the icons will be different from that one. I did alot of research and could not discover how to do this. I have alot of experience with Renderers, but I was unable to change only the root icon. Would anyone who has experience with JTree class know how to chnage only the root icon?

Your feedback would be greatly appreciated. Thanks.

I H
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
works OK in this (but its a very simple tree)

 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Michael Dunn
 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I now have the JTree root displaying a Zip archive icon.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic