How do I hide the "choosable file filter widget" in a JFileChooser? By "choosable file filter widget", I mean the panel below containing the words "File Format".
There's lots of info in the docs on how to modify the specific filters that appear in the widget, but I can't figure out how to hide it entirely.
I'm using the JFileChooser to select a directory, so the widget's unnecessary.
Any ideas?
EDIT
In the end I took Andrew Thompson's suggestion and set the filter chooser to display the text "directories only". In case it helps anyone, I used the following code:
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
fc.setFileFilter( new FileFilter(){
@Override
public boolean accept(File f) {
return f.isDirectory();
}
@Override
public String getDescription() {
return "Directories only";
}
});
Alternately fill it with a "Directories only" text. Then it will appear as the user expects it, with instructions.
File Format: Any Folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With