title: want to write in a file what is actually in Textarea in java
body: <p>Suppose in textarea the lines are,</p>
  
  <pre><code>This is the first line.
  This is the second line.
  </code></pre>
  
  <p>In file it writes</p>
  
  <pre><code>This is the first line. This is the second line.
  </code></pre>
  
  <p>where is my newlines and extra spaces in the second line.</p>
  
  <p>I used getText() to get the value from the textfield.</p>