• Post Reply Bookmark Topic Watch Topic
  • New Topic

Set an icon to the jtree on the click of a button

 
prav ford
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i have a jtree. i need to select a node and when i click a 'lock' button, an icon should appear with the node.
 
KR Campbell
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could extend a DefaultTreeCellRenderer and use setIcon(). Then in your JTree setCellRenderer(myDefaultTreeCellRenderer);
Regards,
Ken
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!