Java - AWT/Swing

Für einen TreeNode den TreePath ermitteln

javax.swing.tree.TreePath
javax.swing.tree.TreeNode

public TreePath getPath(TreeNode treeNode){
   List list = new ArrayList();
 
   while (treeNode != null) {
      list.add(treeNode);
      treeNode = treeNode.getParent();
   }
   Collections.reverse(list);
 
   return new TreePath(list.toArray());
}



Stichworte:

TreeNode TreePath feststellen ermitteln

Eigene Werkzeuge
Werkzeuge

gratis Counter by GOWEB
seit 9.10.2007