code: private void checkCorpusSourcePathExists(Map<String, Object> corpus)
    {
      if (!corpus.containsKey("source_path"))
      {
        // show dialog to the user 
        int result = JOptionPane.showConfirmDialog(this,
          "No source directory given for "
          + "corpus \"" + corpus.get("name")
          + "\". Do you want to manually select a directory?",
          "Cannot find \"" + corpus.get("name") + "\"",
          JOptionPane.YES_NO_OPTION);
  
        if (result == JOptionPane.YES_OPTION)
        {
          // show directory chooser
          int fileChooseResult = fileChooser.showDialog(this, "Select");
          if (fileChooseResult == JFileChooser.APPROVE_OPTION)
          {
            corpus.put("source_path", fileChooser.getSelectedFile().
              getAbsolutePath());
          }
        }
      }
  
    }
docs: GEN-LAST:event_btCancelActionPerformed