title: How to save a file in java
body: <p>I am trying to create a file from a log report. To save the file I've created a button. When the button is pushed, the following code is executed:</p>
  
  <pre><code>public void SAVE_REPORT(KmaxWidget widget){//save
    try {
      String content = report.getProperty("TEXT");
      File file = new File("logKMAX.txt");
      // if file doesnt exists, then create it
      if (!file.exists()) {
        file.createNewFile();
      }
  
      FileWriter fw = new FileWriter(file.getAbsoluteFile());
      BufferedWriter bw = new BufferedWriter(fw);
      bw.write(content);
      bw.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  } //SAVE_REPORT
  </code></pre>
  
  <p>I have no compilation errors, but there isn't any file saved.</p>
  
  <p>Any idea on what might be wrong?</p>