title: Displaying an array list with each element on a new line?
body: <p>Code: </p>
  
  <pre><code>ArrayList &lt;Integer&gt; marks = new ArrayList();
  
  private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {
      Collections.addAll(marks, (Integer.parseInt(markInput.getText())));
      marks.add(Integer.parseInt(markInput.getText()));
      for (int j =0; j &lt; marks.size(); j++) {
          markdisplayTextArea.setText(Integer.toString(marks.get(j)));
  }
  </code></pre>
  
  <p>This program is supposed to display each number on a new line in a JTextArea when the user types it in and presses the "add" button. </p>
  
  <p>It displays each number but only one at a time. I want each number entered to be displayed on a new line in ascending. So if the user entered 4 numbers, say, 78, 92, 54, and 21, I want them displayed like this:</p>
  
  <p>21<br/>
  54<br/>
  78<br/>
  92<br/></p>