Solved

Add a DefaultMutableTreeNode to the root

Posted on 2002-05-19
5
218 Views
Last Modified: 2011-10-03
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
Comment
Question by:s_lavie
  • 3
5 Comments
 

Expert Comment

by:gsvikram
ID: 7019794
Add the tree the TreeExpansionListener.
Follow the JAVA API for the further methonds
0
 
LVL 92

Accepted Solution

by:
objects earned 50 total points
ID: 7020569
Add a tree model listener to your model that expands a node when it is added to the tree.
0
 
LVL 2

Author Comment

by:s_lavie
ID: 7020887
It's not what I ask!
0
 
LVL 92

Expert Comment

by:objects
ID: 7020889
What did you ask then?
0
 
LVL 92

Expert Comment

by:objects
ID: 7020902
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now