code: public void flush2file() {
          StringBuffer filename = new StringBuffer();
          {
              Calendar now = Calendar.getInstance();
              filename.append(now.get(Calendar.YEAR));
              int month = now.get(Calendar.MONTH) + 1;
              filename.append((month < 10 ? "0" : "") + month);
              int day = now.get(Calendar.DAY_OF_MONTH);
              filename.append((day < 10 ? "0" : "") + day);
              int militaryHour = now.get(Calendar.HOUR_OF_DAY);
              filename
                      .append("-" + (militaryHour < 10 ? "0" : "") + militaryHour);
              int minute = now.get(Calendar.MINUTE);
              filename.append((minute < 10 ? "0" : "") + minute);
              int second = now.get(Calendar.SECOND);
              filename.append((second < 10 ? "0" : "") + second);
              int milliseconds = now.get(Calendar.MILLISECOND);
              filename
                      .append("-"
                              + (milliseconds < 10 ? "00"
                                      : milliseconds < 100 ? "0" : "")
                              + milliseconds);
              filename.append(".txt");
          }
          try {
              File file = new File(directoryPath, filename.toString());
              FileOutputStream fileOutputStream = new FileOutputStream(file);
              PrintStream userLog = new PrintStream(fileOutputStream);
              userLog.print(jTextArea.getText());
              userLog.close();
          } catch (FileNotFoundException e) {
              jTextArea.append("COULD NOT WRITE PROCESSING REPORT TO FILE!!!\n");
          }
      }
docs: write processing progress report to directory stored by
  setDirectoryPath(). contents is jTextArea.getText(); filename based on
  current time. see also BatchThread.java, which calls flush2file().