[code]
private void saveData (java.io.FileWriter _output) throws java.lang.Exception {
    // include one line for each ASCII line in your file
    _output.write("A line of text\r\n"); // \r\n in Windows, only \n in Unix
    _output.write("Another line of text\r\n");
  }

  private boolean saveToFile (String _filename) {
    try {
      java.io.File file = new java.io.File(_filename);
      java.io.FileWriter fout = new java.io.FileWriter(file);
      saveData (fout);
      fout.close();
      return true;
    }
    catch (java.lang.Exception ioe) {
      System.err.println ("Error when trying to save"+_filename);
      ioe.printStackTrace(System.err);
      return false;
    }
  }

[/code]


You can write
[b]System.out.println[/b]([i]String_data[/i]);
to output String to java console as a quick way to get data.

If you need to read data from file
[code]
  private void readData (java.io.LineNumberReader _input) throws java.lang.Exception {
      String line = _input.readLine();
      while (line != null) {
        // Process the input line according to your needs:
        _println (line);
        line = _input.readLine();
      }
  } 

  private boolean readFromFile (String _filename) {
    try {
      java.io.Reader reader=null;
      if (_filename.startsWith("url:")) {
        java.net.URL url = new java.net.URL (_filename.substring(4));
        reader = new java.io.InputStreamReader(url.openStream());
      }
      else {
        java.io.File file = new java.io.File(_filename);
        reader = new java.io.FileReader (file);
      }
      java.io.LineNumberReader lineReader = new java.io.LineNumberReader(reader);
      readData (lineReader);
      reader.close();
      return true;
    }
    catch (java.lang.Exception ioe) {
      System.err.println ("Error when trying to read "+_filename);
      ioe.printStackTrace(System.err);
      return false;
    }
  }

  public void read () { readFromFile (filename); }
[/code]

I believe you should be able to search the web for more information about "How to write data to a file"!