Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!