title: Buffered writer in a loop is creating empty lines in txt file
body: <p>Link to entire code: <a href="http://pastebin.com/Y0FA7zuG" rel="nofollow">http://pastebin.com/Y0FA7zuG</a></p>
  
  <p>My code:</p>
  
  <pre><code>public void dadUpdateFunction(ArrayList&lt;JTextArea&gt; texts)
  {
    try{
      //Specify the file name and path here
      File file =new File("C:\\Users\\Karan\\Documents\\dadTXT.txt");
  
      /* This logic is to create the file if the
       * file is not already present
       */
      if(!file.exists()){
        file.createNewFile();
      }
  
      //Here true is to append the content to file
      FileWriter fw = new FileWriter(file,true);
  
      //BufferedWriter writer give better performance
      BufferedWriter bw = new BufferedWriter(fw);
      String content = "Karan";
      int i= 0;
  
      for(i= 0; i&lt;texts.size(); i++)
      {
        content = (texts.get(i).getText() );
        if(i!=0) 
          bw.newLine();
  
        if(i&gt;0)   
          texts.get(i-1).setEditable(false);
      }
  
      bw.write(content + "\n");
      //Closing BufferedWriter Stream
      bw.close();
  
      System.out.println("Data successfully appended at the end of file");
  
    }catch(IOException ioe){
       System.out.println("Exception occurred:");
    }
  }
  </code></pre>
  
  <p>So I have an arraylist of JTextArea. In my program a user can write inth e JTextArea and then click this update button, and the text written in the latest JTextArea box gets added to a txt file. However the output I am getting in my txt file is outputting like this: <a href="http://pastebin.com/fijFQKZi" rel="nofollow">http://pastebin.com/fijFQKZi</a></p>
  
  <p>I don't want the empty lines in between the numbers, as this messes up my buffered reader later. Why is it adding these empty lines?</p>
  
  <p>How do I fix this? I am new on here, so if I did not write something properly let me know. T</p>
  
  <p>Thank you!</p>