code: private void buttonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSaveActionPerformed
      final File home = new File(System.getProperty("user.home")); //NOI18N
      final File toSave = new FileChooserBuilder("user-home-dir").
          setTitle(java.util.ResourceBundle.getBundle("com/igormaznitsa/nbmindmap/i18n/Bundle").getString("PlainTextEditor.buttonSaveActionPerformed.saveTitle")).
          addFileFilter(TEXT_FILE_FILTER).setFileFilter(TEXT_FILE_FILTER).
          setFilesOnly(true).
          setDefaultWorkingDirectory(home).
          showSaveDialog();
      if (toSave != null) {
        try {
          final String text = getText();
          FileUtils.writeStringToFile(toSave, text, "UTF-8"); //NOI18N
        }
        catch (Exception ex) {
          LOGGER.error("Error during text file saving", ex); //NOI18N
          NbUtils.msgError(null, java.util.ResourceBundle.getBundle("com/igormaznitsa/nbmindmap/i18n/Bundle").getString("PlainTextEditor.buttonSaveActionPerformed.msgError"));
        }
      }
    }
docs: GEN-LAST:event_buttonLoadActionPerformed