• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jtree help

 
Carl John
Ranch Hand
Posts: 47
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.......



 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
assuming you mean all nodes the same, change it via the UIManager's open and closed Icons
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or for this tree only, create a DefaultTreeCellRenderer and change its icons, then set this renderer for the tree.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic