Here you can find the source of setFullyExpandedPath(JTree Target, TreeModel TheModel, Object Node, Vector Path)
protected static void setFullyExpandedPath(JTree Target, TreeModel TheModel, Object Node, Vector Path)
//package com.java2s; //License from project: Apache License import java.util.*; import javax.swing.*; import javax.swing.tree.*; public class Main { protected static void setFullyExpandedPath(JTree Target, TreeModel TheModel, Object Node, Vector Path) { if (TheModel.isLeaf(Node) || TheModel.getChildCount(Node) == 0) { Object[] FullPath = new Object[Path.size()]; Path.copyInto(FullPath); Target.expandPath(new TreePath(FullPath)); return; }//from w w w .java 2 s. c om for (int i = 0; i < TheModel.getChildCount(Node); i++) { Object Child = TheModel.getChild(Node, i); Path.addElement(Child); setFullyExpandedPath(Target, TheModel, Child, Path); Path.removeElement(Child); } } }