wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Jtree help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jtree help" Watch "Jtree help" New topic
Author

Jtree help

Carl John
Ranch Hand

Joined: Jun 14, 2010
Posts: 47

hi

i'm developing a swing application.In that application, i'm using jtree.


In default, only folder icon is assigned to each node. I want to assign each node with a icon image.(Like assigning icon to

jbutton). please guide me to do this.......




CJohn
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10268
    
    8

Recommended reading http://download.oracle.com/javase/tutorial/uiswing/components/tree.html#display


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
assuming you mean all nodes the same, change it via the UIManager's open and closed Icons
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19679
    
  18

Or for this tree only, create a DefaultTreeCellRenderer and change its icons, then set this renderer for the tree.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jtree help