Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By Fubarable

Thread: Tell a jTextArea to keep the text it already has and put new text on a new line

  1. #1
    Burnett98 is offline Member
    Join Date
    Jun 2012
    Posts
    13
    Rep Power
    0

    Default 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.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default 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
    Last edited by Fubarable; 06-02-2012 at 10:52 PM.
    DarrylBurke likes this.

  3. #3
    Burnett98 is offline Member
    Join Date
    Jun 2012
    Posts
    13
    Rep Power
    0

    Default Re: Tell a jTextArea to keep the text it already has and put new text on a new line

    Thanks, and will do.

Similar Threads

  1. Replies: 7
    Last Post: 03-05-2011, 09:25 AM
  2. Replies: 1
    Last Post: 02-28-2011, 05:30 PM
  3. Replies: 8
    Last Post: 12-28-2010, 02:24 PM
  4. JTextArea - text align
    By bradder in forum AWT / Swing
    Replies: 1
    Last Post: 11-29-2007, 07:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •