Tell a jTextArea to keep the text it already has and put new text on a new line
Does anyone know how to do this? I have already tried to find a way to do this, but I can't really figure this out. Sorry if it's really obvious and I'm just missing this. Thanks for any help.
Re: Tell a jTextArea to keep the text it already has and put new text on a new line
You're looking for using the JTextArea#append(String text) method. If you want text on a new line, just be sure to add an "\n" on the end of any text appended to the JTextArea.
More importantly, you'd have been able to solve this question yourself quite quickly by simply going to the Swing JTextArea tutorial and API and checking out what methods are available to JTextAreas. If you don't have these links saved in your browser, please be sure to do this now.
You can find the JTextArea tutorial here: JTextArea Tutorial
the Java Tutorials here: The Really Big Index
The JTextArea API here: JTextArea API
And the Java API here: Java API
Re: Tell a jTextArea to keep the text it already has and put new text on a new line