This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Show expanded JTree 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 "Show expanded JTree" Watch "Show expanded JTree" New topic
Author

Show expanded JTree

Ezra Exposito
Ranch Hand

Joined: Apr 26, 2001
Posts: 34
By default a JTree is displayed with only the root node
expanded. I would like to display the tree completely
expanded from the start since the most important information
in my app are at the leaf nodes. Any ideas or links to good
resources would be greatly appreciated.
Thanks
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Ezra,
As a quick and dirty approach I would do the following:

Regards,
Manfred.
Ezra Exposito
Ranch Hand

Joined: Apr 26, 2001
Posts: 34
Thanks a bunch, my tree is now fully expanded when it starts.
One last question:
Within a folder the default is to display the subfolders first and then any leaves. Is it possible to reverse the order so that
the leaves are first and then the folders ?
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Show expanded JTree
 
Similar Threads
JTree
Radiobuttons in JTree
JTree Nodes Collapsing....
JTree
JTree in Browser