Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make the whole tree expanded?

 
Linda Xu
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give this a try:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic