I suggest you look at these methods
in TreeModel
isLeaf
in TreeNode
isLeaf
getAllowsChildren
in DefaultTreeModel (if you are using this or a derivative)
setAsksAllowsChildren
in DefaultMutableTreeNode (if you are using this or a derivative)
setAllowsChildren
No need to mess with renderers or setting icons unless you
really need to for some other reason.
> -----Original Message-----
> From: Pradeep, Chinnaswamiah [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 20, 2001 8:39 AM
> To: [EMAIL PROTECTED]
> Subject: Problem with JTree.
>
>
> Hi ,
>
> Is there a method to display a node as a folder even if
> the folder contains
> no subfolders or files (nodes) ?
> If a folder contains no subfolders or nodes the folder
> appears as a node
> in the JTree. How can I change the look of this to folder ?
> Any specific
> function in the API or workarounds would be appreciated.
>
> Thanks in advance
> Pradeep
> _______________________________________________
> Advanced-swing mailing list
> [EMAIL PROTECTED]
> http://eos.dk/mailman/listinfo/advanced-swing
>
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing