title: How to take multi line input using jtextarea in java netbeans?
body: <p>What i want to do is take input from the user in multi lines, suppose user inputs some details in multi line textarea control<br>
  ================<br>
  Sarah<br>
  Jones<br>
  Chris<br>
  Samantha<br>
  ================<br>
  Now i want to insert these lines into an array, modify the details a bit<br> then show them in a second textarea or label.<br>
  I want the output something like this<br>
  ================<br>
  Welcome sarah<br>
  welcome jones<br>
  welcome chris<br>
  welcome samantha<br>
  ================<br></p>
  
  <p>I heard we can do this using split method but it is not giving me the result <br>i want. This is the code i prepared so far.</p><br></p>
  
  <pre><code>private void jButton1ActionPerformed(java.awt.event.ActionEvent evt){                                         
         String[] names = jTextArea1.getText().split("\\.");
         for(int i=0;i&lt;names.length;i++)
         {
          jTextArea2.setText("welcome "+names[i]);
         }
  }
  </code></pre>
  
  <p><p>output is<br>
  ==============<br>
  welcome sarah<br>
  jones<br>
  chris<br>
  samantha<br>
  ==============<br>
  welcome is only printed once, what am i doing wrong?</p>