Link to home
Start Free TrialLog in
Avatar of s_lavie
s_lavie

asked on

Add a DefaultMutableTreeNode to the root

Hi,
I use the class MyJTree with one MyDefaultMutableTreeNode (as a root) in its MyDefaultTreeModel.
Where:

MyJTree extends JTree
MyDefaultMutableTreeNode extends DefaultMutableTreeNode
MyDefaultTreeModel extends DefaultTreeModel

When I add a child node, it only seen if I double-click the root.
I want it to be seen automatically.
How do I do this easily?
Thanks.
Avatar of gsvikram
gsvikram

Add the tree the TreeExpansionListener.
Follow the JAVA API for the further methonds
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of s_lavie

ASKER

It's not what I ask!
What did you ask then?