code: private void buttonExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExportActionPerformed
      final File toSave = DialogProviderManager.getInstance().getDialogProvider().msgSaveFileDialog(null, "note-editor", UiUtils.BUNDLE.getString("PlainTextEditor.buttonSaveActionPerformed.saveTitle"), null, true, TEXT_FILE_FILTER, "Save"); //NOI18N
      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
          DialogProviderManager.getInstance().getDialogProvider().msgError(Main.getApplicationFrame(), UiUtils.BUNDLE.getString("PlainTextEditor.buttonSaveActionPerformed.msgError"));
        }
      }
  
    }
docs: GEN-LAST:event_buttonImportActionPerformed