question: private void expandAllNodes ( JTree tree , TreePath parentPath ) { TreeNode node = ( TreeNode ) parentPath . getLastPathComponent ( ) ; for ( int i = 0 ; i < node . getChildCount ( ) ; i ++ ) { expandAllNodes ( tree , parentPath . pathByAddingChild ( node . getChildAt ( i ) ) ) ; } tree . expandPath ( parentPath ) ; }
target:  Recursive method to expand all the nodes of a tree.