Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes JTree Leaf Node Folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree Leaf Node Folder" Watch "JTree Leaf Node Folder" New topic
Author

JTree Leaf Node Folder

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I have a JTree that I populate from a database. I have a Root Node, Then Catagory Nodes, and under those, I have SubCatagory Nodes.
If the Sub Catagory Node has no children, which some may until the Database get's more entries, they show up as a Leaf Node, with the Leaf Node Icon.
Is there a way to force them to be Parent Nodes with No Children instead of a leaf node, and then get them the proper folder icon?


GenRocket - Experts at Building Test Data
 
Consider Paul's rocket mass heater.
 
subject: JTree Leaf Node Folder
 
Similar Threads
JCheckBox in Jtree Problem
JTree and indent
Dynamic JTree Components
Setting Leaf in the JTree (Urgent)
Subtree in JTree