Need to modify JFileChooser's default behavior

R

Ramon F Herrera

The problem I am facing is solved in Unix with this:

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
 
R

Ramon F Herrera

The problem I am facing is solved in Unix with this:


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 class? :)

Well, perhaps there isn't such a class per se, but this comes pretty
darn close:

fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

-Ramon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top