File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Setting Leaf in the JTree (Urgent) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Setting Leaf in the JTree (Urgent)" Watch "Setting Leaf in the JTree (Urgent)" New topic

Setting Leaf in the JTree (Urgent)


Joined: Jul 03, 2001
Posts: 1
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.
if anybody can help me out, i'll be thankful
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at . 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.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Setting Leaf in the JTree (Urgent)
jQuery in Action, 3rd edition