Java JTextArea appendNewLine(final JTextArea textArea, final String line)

Here you can find the source of appendNewLine(final JTextArea textArea, final String line)

Description

Appends a line and a new line to a text area.

License

Apache License

Parameter

Parameter Description
textArea text area to append to
line line to be appended

Declaration

public static void appendNewLine(final JTextArea textArea, final String line) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.swing.JTextArea;

public class Main {
    /**/*from   w w w  .  j  a v  a 2  s.  c o  m*/
     * Appends a line and a new line to a text area.
     * @param textArea text area to append to
     * @param line     line to be appended
     */
    public static void appendNewLine(final JTextArea textArea, final String line) {
        textArea.append(line);
        textArea.append("\n");
        textArea.setCaretPosition(textArea.getDocument().getLength());
    }
}

Related

  1. addMessageLogger(JTextArea t)
  2. addStyle(JTextArea textArea, String labelName, boolean isBorder)
  3. adjustToText(JTextArea testString)
  4. applyDefaultProperties(final JTextArea comp)
  5. attachSimpleUndoManager(JTextArea jta)
  6. blockUncomment(JTextArea scriptPanel)
  7. clearTextArea(JTextArea textArea)