Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Removing handles from JTree nodes

 
B Bhutta
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to remove handles from the JTree. I was able to remove handle from JTree root by the method tree.setShowRootsHandles(false) but I dont know how I can remove handles from the leaf(roots under the tree). Thanks for the help.
Thanks.
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Babar,
you need to write your own TreeCellRenderer. See the tutorial for detailed information:
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#display
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe that was a bit to short:
in your TreeCellRenderer subclass: instead of defining a new Icon you provide no icon at all.
c
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!