+
+ FileFilter f = jfc.getFileFilter();
+ // deselect the selected file if it's no longer choosable
+ File selectedFile = jfc.getSelectedFile();
+ if (selectedFile != null && !f.accept(selectedFile))
+ {
+ jfc.setSelectedFile(null);
+ }
+ // fake the OK button changing (to force it to upate)
+ String s = jfc.getApproveButtonText();
+ jfc.firePropertyChange(
+ APPROVE_BUTTON_TEXT_CHANGED_PROPERTY, null, s);
+ // fake the file filter changing (its behaviour actually has)
+ jfc.firePropertyChange(FILE_FILTER_CHANGED_PROPERTY, null, f);
+