File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to make the whole tree expanded? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to make the whole tree expanded?" Watch "How to make the whole tree expanded?" New topic
Author

How to make the whole tree expanded?

Linda Xu
Ranch Hand

Joined: Feb 14, 2000
Posts: 51
Hi,
I have a JTree on my GUI, for some reason, each time when a new node added / deleted to/from the tree, I want the whole tree been expanded, that means all nodes in the tree are visible.
I found a method
public void scrollPathToVisible(TreePath path)
in class JTree, but this method only expand one path, all the others are collasped.
Is there any method can expand the whole tree?
Thanks!
John Smith
Ranch Hand

Joined: Jul 20, 2001
Posts: 84
Give this a try:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to make the whole tree expanded?