Java JTextArea printInTextArea(JTextArea log, String[] toPrint)

Here you can find the source of printInTextArea(JTextArea log, String[] toPrint)

Description

print In Text Area

License

Open Source License

Declaration

public static void printInTextArea(JTextArea log, String[] toPrint) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.List;
import javax.swing.JTextArea;

public class Main {
    private static String NEWLINE = "\n";

    public static void printInTextArea(JTextArea log, String toPrint) {
        log.append(toPrint + NEWLINE);//  ww  w  .  j  a v  a  2  s.  c  om
    }

    public static void printInTextArea(JTextArea log, String[] toPrint) {
        for (int i = 0; i < toPrint.length; i++)
            log.append(toPrint[i] + NEWLINE);
    }

    public static void printInTextArea(JTextArea log, List<String> toPrint) {
        String[] toPrintArray = new String[toPrint.size()];
        toPrint.toArray(toPrintArray);
        printInTextArea(log, toPrintArray);
    }
}

Related

  1. makeTabMoveFocus(JTextArea textArea)
  2. out(final JTextArea ta)
  3. preventInputingNewLineOnTextArea(JTextArea txe, AbstractAction actionOnEnter)
  4. printExceptionInfo(Exception e, JTextArea console)
  5. printInfo(JTextArea txtInfo, String infoString)
  6. printStackTrace(Exception e, JTextArea console)
  7. printStream(final JTextArea ta)
  8. registerUndoManager(JTextArea textArea)
  9. setCaretPosition(int i, int j, JTextArea jtextarea)