title: File Reading Multiple Lines to One String
body: <p>I have a JTextArea (aka <em>"notes"</em>)where a user can type text and space it in any format they wish. The String is then stored in a file <strong>with other Strings</strong> to be read in late. The "notes" String should be read in later and placed back into the JTextArea with the same formatting as it was originally saved.</p>
  
  <p>If you had 2 text areas, doing this would transfer the correct formatting:</p>
  
  <pre><code>JTextArea text1 = new JTextArea();
  JTextArea text2 = new JTextArea();
  
  text2.setText(text1.getText);
  </code></pre>
  
  <p>However, writing to a file is different due to the fact that <code>in.next();</code> reads <em>one</em> String, not an entire text area's worth.</p>
  
  <p>How would you be able to maintain the correct formatting after reading the/multiple Strings in from the text file?</p>
  
  <p><strong>EDIT:</strong> the file would look something like this:</p>
  
  <pre><code>String1
  String2
  some_long_string
  12345
  foobar
  This string was taken from the JTextArea mentioned above. Imagine that this is all one String and has a lot of whitespace in it.
  </code></pre>