This week's book giveaway is in the Design and Architecture forum. We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line! See this thread for details.
Hi, I have a JTree with lots of parent nodes and children nodes of the parent nodes.Within one parent node I have many other parent nodes with and without children nodes.The parent nodes without children are displayed as leaf nodes,instead of being displayed as parent nodes itself. I want to display parent nodes as parent nodes only even if it does not contain any children. PLEASE HELP ME OUT IN THIS REGARD AS THIS IS A VERY CRUCIAL ELEMENT OF MY PROJECT.IF POSSIBLE PLEASE GIVE ME AN EXAMPLE. THANK YOU SHARATH
no need to cry out loud... have you had a look at TreeModel? if not you should. implement you own (or extend it from DefaultTreeModel). overwrite the method isLeaf(node) and getChildCount(node) etc. see the swing tutorial on JTree. you might want to provide your custom TreeNode implementation as well. cheers, Chantal
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad: