chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int rc = chooseFile(chooser, "Add source directory");
chooser.setFileFilter(archiveAndDirectoryFilter); chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); int rc = chooseFile(chooser, "Add source directory or archive");
    private void browseSrcDirButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseSrcDirButtonActionPerformed	JFileChooser chooser = createFileChooser();        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);	int rc = chooseFile(chooser, "Add source directory");        if (rc == JFileChooser.APPROVE_OPTION) {            srcDirTextField.setText(chooser.getSelectedFile().getPath());            addSourceDirToList();        }    }//GEN-LAST:event_browseSrcDirButtonActionPerformed