Using a custom FileFilter with a JFileChooser?

The JFileChooser needs you to extend an instance of javax.swing.filechooser. FileFilter Since you have implements your IDE is importing java.io. FileFilter instead.

The JFileChooser needs you to extend an instance of javax.swing.filechooser.FileFilter. Since you have implements your IDE is importing java.io. FileFilter instead.

Thanks, I did that and now it works, but by default the directory is 'Documents' in my filechooser, so no images are there obviously. When I try to navigate to another directory, they won't show. How can I make the default directory when the filechooser opens set to my Picture folder?

– Chris V. Jan 28 at 20:12 Use the setCurrentDirectory method of JFileChooser. Are you sure your filter isn't just rejecting all possible files?

I would put a breakpoint in the accept method to test. – Pace Jan 28 at 20:41.

Your file filter should accept directories as well. If (file.isDirectory()) return true; even tho your file selection mode is files only (which is correct).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions