How can I write a directory chooser as like that:

or:

at Java?
PS 1: I am developing a desktop application and I use Swing at my application.
PS 2: I want to list just directories.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use a TreeTable, here’s a directory scanner using a treetable with a pretty decent tutorial: http://java.sun.com/products/jfc/tsc/articles/treetable1/
Your second picture looks just like JFileChooser…
If you want to change it’s behavior just create a MyFileChooser class that extends JFileChooser.