You can use TreeTable, here is a directory scanner that uses a standard table with a pretty decent tutorial: http://java.sun.com/products/jfc/tsc/articles/treetable1/
The second image looks the same as JFileChooser ...
JFileChooser fileChooser = new JFileChooser(file);
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
If you want to change its behavior, just create a class MyFileChooser, which extends JFileChooser.
source
share