Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

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.
0
s_lavie
Asked:
s_lavie
  • 3
1 Solution
 
gsvikramCommented:
Add the tree the TreeExpansionListener.
Follow the JAVA API for the further methonds
0
 
objectsCommented:
Add a tree model listener to your model that expands a node when it is added to the tree.
0
 
s_lavieAuthor Commented:
It's not what I ask!
0
 
objectsCommented:
What did you ask then?
0
 
objectsCommented:
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now