public class MyPanel extends JPanel { private JTextArea ta; public MyPanel() { super(); ta = new JTextArea(); this.setLayout(new GridLayout(1,1)); //ta nimmt volle Größe ein this.add(new JScrollPane(ta)); } public void println(String s) { ta.setText(ta.getText() + '\n' + s); } public void clear() { ta.setText(""); } }