@Override public void run() { JFileChooser fc = new JFileChooser(System.getProperty("user.dir")); FileFilter[] ff = sortFilters(filters); FileFilter combo = null; if (ff.length > 0 && ff[0] instanceof ComboFileFilter) { // check for existing "All supported file types" filter ComboFileFilter cff = (ComboFileFilter) ff[0]; if (ALL_TYPES.equals(cff.getDescription())) combo = cff; } // make an "All supported file types" filter if we don't have one yet if (combo == null) { combo = makeComboFilter(ff); if (combo != null) fc.addChoosableFileFilter(combo); } for (int i=0; i<ff.length; i++) fc.addChoosableFileFilter(ff[i]); if (combo != null) fc.setFileFilter(combo); if (preview) new PreviewPane(fc); jfc[0] = fc; } };
@Override public void run() { JFileChooser fc = new JFileChooser(System.getProperty("user.dir")); FileFilter[] ff = sortFilters(filters); FileFilter combo = null; if (ff.length > 0 && ff[0] instanceof ComboFileFilter) { // check for existing "All supported file types" filter ComboFileFilter cff = (ComboFileFilter) ff[0]; if (ALL_TYPES.equals(cff.getDescription())) combo = cff; } // make an "All supported file types" filter if we don't have one yet if (combo == null) { combo = makeComboFilter(ff); if (combo != null) fc.addChoosableFileFilter(combo); } for (int i=0; i<ff.length; i++) fc.addChoosableFileFilter(ff[i]); if (combo != null) fc.setFileFilter(combo); if (preview) new PreviewPane(fc); jfc[0] = fc; } };