Results 1 to 3 of 3
  1. #1
    chimpy is offline Member
    Join Date
    Dec 2016
    Posts
    2
    Rep Power
    0

    Default [SOLVED] Same output in jTextArea as in console

    Hello,

    I can't figure out how to get the same output in a jTextArea as in my console.
    Here is the relevant peace of code:

    Java Code:
                        for(int i = 0;i < mesg.length; i++){
    
                            //print subjects of my ISP inbox
                            System.out.println(mesg[i].getSubject());   
                            termOutput.setText(mesg[i].getSubject());
                        
                        }
    The System.out.println gives a list of my inbox Subjects in the console. That works fine.
    But the jTextArea (termOutput) only shows the last message Subject.
    I have no limit of displaying lines set for the jTextArea.
    Do I overlook something?

    Thanks
    Last edited by chimpy; 02-10-2017 at 01:36 AM. Reason: Solved

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Same output in jTextArea as in console

    Compare the setText method with the append method.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    chimpy is offline Member
    Join Date
    Dec 2016
    Posts
    2
    Rep Power
    0

    Default Re: Same output in jTextArea as in console

    OK Norm,

    Thanks. I was looking for that.

Similar Threads

  1. Real Time Console output to JTextArea ?
    By SpiderD in forum AWT / Swing
    Replies: 1
    Last Post: 06-07-2013, 11:57 PM
  2. Replies: 2
    Last Post: 02-16-2013, 12:23 AM
  3. Console like Environment in JTextArea
    By Kyle227 in forum AWT / Swing
    Replies: 4
    Last Post: 02-25-2011, 07:26 PM
  4. Need help with printing console output to JTextArea
    By ShinTec in forum AWT / Swing
    Replies: 4
    Last Post: 06-04-2010, 10:10 AM
  5. How Do You?? Get the Console Output as a GUI??
    By Lyricid in forum AWT / Swing
    Replies: 10
    Last Post: 11-20-2009, 11:35 PM

Posting Permissions

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