void () { collapseRoot(); TreePath[] treePaths = new TreePath[20]; for (int i = 0; i < treePaths.length; i++) { DefaultMutableTreeNode child = new DefaultMutableTreeNode(); myTreeModel.insertNodeInto(child, myChild2, 0); addChildren(20, child); treePaths[i] = myChild2Path.pathByAddingChild(child); } TreeExpandCollapse.expandAll(myTree); for (TreePath treePath : treePaths) { checkExpanded(treePath); } }