title: Moving Cursor Down a line - Java
body: <p>I have created a JtextArea, and after having added a piece of text to the text area, want to cursor to be moved to the next line. I.e. I append the string to the text area, and when the user starts typing into the text area, want the input to be on the next line, not on the same line, at the end of the string I appended. </p>
  
  <pre><code>import javax.swing.JTextArea;
  import javax.swing.JFrame;
  public class NewSecureChat{
  private JFrame myFrame;
  private JTextArea chatArea;
  public static void main(String[] args) {
      public NewSecureChat() throws UnknownHostException  {
      JFrame myFrame = new JFrame();
      myFrame.setSize(900, 400);
      myFrame.setLocation(400, 400);
      myFrame.setTitle("SecureChat 1.0" + (Inet4Address.getLocalHost().getHostAddress()));
      myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      myFrame.setAlwaysOnTop(true);
  
      panel1 = new JPanel();  
      chatArea = new JTextArea("Chat here!", 3, 5);
      panel5.add(chatArea);
      chatArea.append("&gt; Blank Message" + "\n");
  
      }
  }
  }
  </code></pre>