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