TreePath
- From: ptomblin+netnews@xxxxxxxxx (Paul Tomblin)
- Date: Tue, 26 Sep 2006 13:29:34 +0000 (UTC)
It seems to me that if your tree contains TreeNodes, it should be trivial
to construct a TreePath for a TreeNode by just calling ".getParent()" on
each node in turn until you reach the root, pushing each node onto the top
of a stack. So it seems almost an oversight to me that TreePath doesn't
have a constructor that takes a single TreeNode, or that any of the known
TreeNode implementations (DefaultMutableTreeNode,
JTree.DynamicUtilTreeNode) includes a method to get a TreePath for that
node.
Oh well, I guess I'll write my own TreeNode implementation that does it.
--
Paul Tomblin <ptomblin@xxxxxxxxx> http://xcski.com/blogs/pt/
"Fly the airplane, then work the problem"
-- Rick Grant (quoting RCAF pilot training)
.
- Follow-Ups:
- Re: TreePath
- From: alyawn
- Re: TreePath
- From: Steve W. Jackson
- Re: TreePath
- From: Thomas Weidenfeller
- Re: TreePath
- Prev by Date: Re: panel size vs. frame size
- Next by Date: Re: TreePath
- Previous by thread: ComboBox width before setVisible??
- Next by thread: Re: TreePath
- Index(es):
Relevant Pages
|