Learn how to a build a cloud-first strategyRegister Now


Jtree with setRootVisible

Posted on 2005-05-09
Medium Priority
Last Modified: 2010-08-05
I have a tree, now if I use setRootVisible(false) to hide the root, and I want if the direct child of this root (level 1) has the childrens (leve 2), the sign (+) will be display before the child level 1. I run some JTree example, but the (+) sign not displayed...
How can I do?
Thank you
Question by:nphnhi
  • 5
LVL 37

Accepted Solution

zzynx earned 150 total points
ID: 13958336
LVL 37

Expert Comment

ID: 13958354
void setShowsRootHandles(boolean)

Set whether the tree shows handles for its leftmost nodes, letting you expand and collapse the nodes.
The default is false. If the tree doesn't show the root node, then you should invoke setShowsRootHandles(true).
LVL 37

Expert Comment

ID: 13958363
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 13958547
may this is because of your operating system (if windows then windxp ) problem.
LVL 37

Expert Comment

ID: 13958672
Thanks for accepting.

For my interest: Could you tell me what you missed in my comment for not awarding it with an A?
For your interest: You can always ask for more explanation if you're not completely satisfied with a comment.

Author Comment

ID: 13959630
Infact, I don't know that it isn't satify you because I just made a comment "good answer" :) Sorry, I will do another time for an excellent answer :)
LVL 37

Expert Comment

ID: 13959665
Well, I interpret a "good answer" (or B-grade) as: it's OK, but it could have been better/more specific.
Since it was exactly what you needed, I thought it deserved an A-grade.

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn different types of Android Layout and some basics of an Android App.
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 …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month21 days, 2 hours left to enroll

810 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