Solved

Jtree + Dir structure - limit to 1 level

Posted on 2003-11-10
3
332 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java Message handling in Service Layer 3 58
javap bin 2 30
windows explorer path to command prompt 5 33
servlet example 17 12
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 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 …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
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.

863 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

21 Experts available now in Live!

Get 1:1 Help Now