The problem I am facing is solved in Unix with this:
> ls -ld *
My JFileChooser instance is supposed to retrieve a filepath with a
directory at the end.
An option would be to have a double click opening directories and a
button press to signify the end of the search. Or I could even hava
one button to open folders and another to signify that I am done.
What needs to be done to have JFileChooser chose directories?
Is there a JDirectoryChooser? :-)
-Ramon
Andrew Thompson - 13 Nov 2007 02:26 GMT
...
>What needs to be done to have JFileChooser chose directories?
>
>Is there a JDirectoryChooser? :-)
Whoa! Nothing so drastic. You might try RTFM first.
<http://java.sun.com/javase/6/docs/api/javax/swing/JFileChooser.html#setFileSelec
tionMode(int
)>

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Roedy Green - 13 Nov 2007 02:42 GMT
On Mon, 12 Nov 2007 18:15:52 -0800, Ramon F Herrera
<ramon@conexus.net> wrote, quoted or indirectly quoted someone who
said :
>What needs to be done to have JFileChooser chose directories?
You have at least two tools at your disposal without even subclassing:
addChoosableFileFilter(FileFilter filter)
setFileSelectionMode(int mode)
see http://mindprod.com/jgloss/jfilechooser.html

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Ramon F Herrera - 13 Nov 2007 04:58 GMT
> The problem I am facing is solved in Unix with this:
>
[quoted text clipped - 8 lines]
>
> What needs to be done to have JFileChooser chose directories?
> Is there a JDirectoryChooser class? :-)
Well, perhaps there isn't such a class per se, but this comes pretty
darn close:
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
-Ramon