File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Help with Jtree Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Help with Jtree" Watch "Help with Jtree" New topic

Help with Jtree

shri mon
Ranch Hand

Joined: Jan 11, 2005
Posts: 63
Is it possible to set two different icons for two different leaves in a JTree.

Thanks in advance.
Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
Yes. You need to extend/implement your own TreeCellRenderer.
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
I agree. Here's the link:
subject: Help with Jtree
It's not a secret anymore!