title: How to read from a file into a JTextArea (GUI) line by line?
body: <p>I am reading in from a file (which is a list of names and their contact numbers) and displaying it in a textarea in a GUI. The file reads in fine and the text is displayed. But I want each line from the file to be on a new line on the GUI. So each name and address to be on a new line. How do I do this?
  This is my code so far, but it doesn't display each line from the file on a new line on the GUI.</p>
  
  <pre><code>public void books() throws IOException {
          String result = " ";
          String line;
          LineNumberReader lnr = new LineNumberReader(new FileReader(newFile("books2.txt")));
          while ((line = lnr.readLine()) != null) {
              result += line;`
          }
  
  
          area1 = new JTextArea(" label 1 ");
          area1.setText(result);
          area1.setBounds(50, 50, 900, 300);
          area1.setForeground(Color.black);
          panelMain.add(area1);
  
      }
  </code></pre>