Re: TreePath



Paul,
I think the designers of the API wanted to keep their default tree
model implementation separate from the actual public JTree API.
TreePath belongs to the JTree, TreeModel and TreeModelEvent APIs.
TreeNodes belong to the DefaultTreeModel which is a specific
implementation of the TreeModel API. A little confusing, I know.

I always thought that they should have put the TreeNode,
DefaultMutableTreeNode, etc in a separate (javax.swing.tree.node or
javax.swing.tree.default) package to make life a little easier for
developers who are new to the API. But as other posters have mentioned,
there is an easy way to get at a node's path through the
DefaultTreeModel. And maybe you should submit an RFE for a
TreeNode.getPath() addition to the API. As you mentioned, the code for
that is dirt simple.


-Alan
-http://everydaycoder.com/

.