Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting Leaf in the JTree (Urgent)

 
gautam100
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am having two different type of nodes
1.which are always leaf i.e. can not have children.
2. Which can have children and may be leaf.
So i want to distinguish these 2 type of nodes so that the user may know which can have children and which can not. This difference can be either with a color or icon or anything. I have set setAllowsChildren(true/false), correspondingly also.DefaultTreeCellRenderer won't work ciz that too will set the color of all the leaves same.
SO
if anybody can help me out, i'll be thankful
regards
Gautam
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"gautam100",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic