title: How to setText in a textArea from an ArrayList?
body: <p>I have an ArrayList <code>ArrayList&lt;String&gt; externalDataList = new ArrayList&lt;&gt;(1600);</code>and I would like to display in a textArea first 3 strings, but I can't succed: </p>
  
  <p>Here is my code</p>
  
  <pre><code>textareaShowPreview.setPrefRowCount(3);
  
  Iterator&lt;String&gt; it = externalDataList.iterator();
         int tot = 0;
         while(it.hasNext() &amp;&amp; tot&lt;3){
             String element = it.next();
             textareaShowPreview.setText(element + "\n");
             System.out.println("elements are: " + element);
             tot++;
         }
  </code></pre>
  
  <p>The sout correctly print first 3 strings</p>
  
  <pre><code>element are: 23/05/2007 ,30.9455,31.2545,30.9091,30.9545,7518142
  element are: 24/05/2007 ,30.6545,31.0909,30.5364,30.6909,12851606
  element are: 25/05/2007 ,30.6636,30.8545,30.4818,30.8091,9392088
  </code></pre>
  
  <p>but in textArea I have only first one</p>
  
  <p><img src="https://i.stack.imgur.com/6BMbt.png" alt="enter image description here"></p>
  
  <p>How do I have to modify my code to show in textArea all three strings, one string per row?</p>