Java: Expand First Leaf Node Of JTree

Use this helper method that I created to expand the first leaf node of a JTree object. By default, only the child nodes of the root are displayed. Some cases, you may want to display the very first leaf node of a JTree object.

This method assumes that the first child node of the root has a child of its own. This method also does not care how deep the TreePath is. It will expand all nodes of the TreePath until the leaf node.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *