NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
chaddaniels
Joined: 16 Oct 2008 Posts: 37
|
Posted: Tue Oct 21, 2008 7:39 pm Post subject: Auto-Expand nodes in BeanTreeView |
|
|
| Does anybody know if there is a way to make a Node auto-expand when child nodes are added to it? When using a regular JTree and TreeModel I would normally add a TreeModelListener and expand the parent node on treeNodesInserted. Is there a similar approach for BeanTreeView? |
|
| Back to top |
|
 |
tomwheeler
Joined: 03 Sep 2008 Posts: 950
|
Posted: Wed Oct 22, 2008 1:07 am Post subject: Auto-Expand nodes in BeanTreeView |
|
|
I suppose you could add a NodeListener to the root context of the node
the BeanTreeView is associated with, then calculate a TreePath for the
new node's parent and call BeanTreeView.showPath to display it.
Note the following from the NodeListener javadoc; it should save you
some headaches:
The listener is not notified about changes in subnodes until
the method getChildren().getNodes() is called
On Tue, Oct 21, 2008 at 2:39 PM, chaddaniels <address-removed> wrote:
| Quote: | Does anybody know if there is a way to make a Node auto-expand when child nodes are added to it? When using a regular JTree and TreeModel I would normally add a TreeModelListener and expand the parent node on treeNodesInserted. Is there a similar approach for BeanTreeView?
|
--
Tom Wheeler
http://www.tomwheeler.com/ |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|