How to add text to a textArea instead of replacing it

前端 未结 3 575
我寻月下人不归
我寻月下人不归 2021-02-07 16:46

How can I add text to a JTextArea instead of replacing all of it?

I know about setText(String) but other than that I\'m a bit lost.

3条回答
  •  猫巷女王i
    2021-02-07 17:14

    void append(JTextArea area, String newText){
            area.setText(area.getText() + newText)
    }
    

提交回复
热议问题