Solved

Add a DefaultMutableTreeNode to the root

Posted on 2002-05-19
5
264 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

626 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