public boolean accept(File file) { return file.isDirectory() || file.getName().endsWith(".jar"); }
public boolean accept(File file) { return file.isDirectory() || file.getName().endsWith(".jar") || file.getName().endsWith(".class"); }
    private void browseJarButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseJarButtonActionPerformed        JFileChooser chooser = new JFileChooser(currentDirectory);        FileFilter filter = new FileFilter() {            public boolean accept(File file) { return file.isDirectory() || file.getName().endsWith(".jar"); }            public String getDescription() { return "Jar files (*.jar)"; }        };        chooser.setFileFilter(filter);        chooser.setMultiSelectionEnabled(true);                int rc = chooser.showDialog(this, "Add Jar file");        if (rc == JFileChooser.APPROVE_OPTION) {            File[] selectedFileList = chooser.getSelectedFiles();            for (int i = 0; i < selectedFileList.length; ++i) {                String entry = selectedFileList[i].getPath();                addJarToProject(entry);            }        }    }//GEN-LAST:event_browseJarButtonActionPerformed