At the moment I have my JFileChooser and a FileFilter which specifies
that only files with the extension '.xml' will be shown. This works
fine, but when this filter is selected (which is the default) you can't
see any of the directories because they do not end in '.xml'. Is there
a way to apply the filter to files only, so that directories can still
be viewed when the filter is applied.
Many thanks
Steve
Oliver Wong - 16 Feb 2006 16:46 GMT
> At the moment I have my JFileChooser and a FileFilter which specifies
> that only files with the extension '.xml' will be shown. This works
[quoted text clipped - 3 lines]
> be viewed when the filter is applied.
> Many thanks
Instead of making your file filter do something like:
<pseudocode>
return file.endsWith(".xml");
</pseudocode>
make it do something like:
<pseudocode>
return file.endsWith(".xml") || file.isADirectory();
</pseudocode>
- Oliver
steve_marjoribanks@hotmail.com - 16 Feb 2006 16:56 GMT
Yeah, thanks, I found the answer just after I posted! :-)
Steve