if (rc == JFileChooser.APPROVE_OPTION)
if (rc == JFileChooser.APPROVE_OPTION) {
    private void browseSrcDirButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseSrcDirButtonActionPerformed        JFileChooser chooser = new JFileChooser();        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);        int rc = chooser.showDialog(this, "Add source directory");        if (rc == JFileChooser.APPROVE_OPTION)            srcDirTextField.setText(chooser.getSelectedFile().getPath());    }//GEN-LAST:event_browseSrcDirButtonActionPerformed