Java tutorial
//package com.java2s; import javax.swing.text.JTextComponent; public class Main { public static void appendText(JTextComponent jcomponent, String str) { StringBuilder stringBuilder = new StringBuilder(jcomponent.getText()).append("\n").append(str); jcomponent.setText(stringBuilder.toString()); } }