out.write(text); out.close();
outstream.write(text); outstream.close();
   public synchronized void cleanScreen(boolean save, String directory) {      try {         if (save) {            File file = new File(getFileName(directory));            // Create an output writer that will write to that file.            // FileWriter handles international characters encoding conversions.            FileWriter out = new FileWriter(file, true);            String text = screen.getText();            out.write(text);            out.close();            this.dirty = false;         }         // clears the text of the TextArea         screen.setText("");      } catch (java.lang.Throwable ex) {         System.err.println("Display.cleanScreen():" + ex.getMessage());         try {            out.close();         } catch (Exception exc) {         }      }   }