Solved

Jtree + Dir structure - limit to 1 level

Posted on 2003-11-10
3
333 Views
Last Modified: 2010-08-05
Hi,
  I have a Jtree that represent a directory structure like a Windows explorer.
  the root is C:\ drive

  Is it possible to limit the Jtree to show only the 1st level folder in C:\ ?
  eg:  
      C:\
          folder1   ("+" sign should be hidden if folder1 has subfolders and it is not expandable)
          folder2

Thanks.
0
Comment
Question by:peikfeng
  • 2
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 125 total points
ID: 9719822
Have your TreeModel return true from isLeaf() for the appropriate nodes.
0
 

Author Comment

by:peikfeng
ID: 9720166
Thanks for the clue!!  :)
I have customized my code to do this.
0
 
LVL 92

Expert Comment

by:objects
ID: 9720188
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

813 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

11 Experts available now in Live!

Get 1:1 Help Now