A
Allen
Accept all file filter is default for JFileChooser. I want to remove
it. How to do it?
it. How to do it?
Allen said:Accept all file filter is default for JFileChooser. I want to remove
it. How to do it?
Allen said:Accept all file filter is default for JFileChooser. I want to remove
it. How to do it?
John said:You don't. You replace it.
Andrew said:How?
My quick experiments indicate that ..
setFileFilter(FileFilter)
... is a poorly named ..
addAndSelectFileFilter(FileFilter)
To actually *remove* the initial file filter,
I needed to do this..
JFileChooser jfc = new JFileChooser();
// the first, only, and selected filter is 'All Files'
jfc.removeChoosableFileFilter(
jfc.getFileFilter() );
// ...now add the filter to an empty list
jfc.setFileFilter(new FileTypeFilter(".java")) ;
Is there some other method, I missed?
John said:....
If you must, and are on 1.3 or better, setAcceptAllFileFilterUsed(false).
But every user who wants to damn-well see the "all" list will curse you
for doing so.
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.