1 Reply Latest reply: Apr 25, 2013 7:37 AM by thomas.behr RSS

    Using FileFilter problems with JFileChooser in JDK 1.7.0

    J1286756
      I have an implementation of the FileFilter class used with JFileChooser and it worked for jdk versions upto 1.6.30 by correctly filtering the file types when the JFileChooser was invoked. I then upgraded to jdk1.7.0.10 and suddenly the JFileChooser instead defaults to "All Files" and doesn't filter by file type as it used to. Code fragment below
              JFileChooser chooser = new JFileChooser(aFile.getAbsolutePath());
              chooser.setAcceptAllFileFilterUsed(true);
              chooser.addChoosableFileFilter(fileFilter);
      Is there something else that needs to change.
      I know there is a java implementation of the FileFilter class - FileNameExtensionFilter - but I really would like to know what is causing this change in behaviour between the jdk versions.