title: How to append data in JTextArea in Java?
body: <p>I am using this code to show text in a <code>JTextArea</code>:</p>
  
  <pre><code>jTextArea1.setText(jTextArea1.getText() + text + "\r\n");
  jTextArea1.repaint();
  </code></pre>
  
  <p>But it shows an exception:</p>
  
  <pre><code>java.lang.NullPointerException
  </code></pre>