Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setText() problem

 
Jade Davidson
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to display text in the TextArea of my applet. I am converting the applet from a pre-existing program, where I had the results print out on six separate lines. I am trying to use setText() to display these lines in the TextArea, but only the last lines displays. I think that each subsequent String is obliterating the other ones, so that only the last one is displayed in the TextArea. How can I fix this? Please help... I checked the API for both setText() and getText() and didn't find anything that mentioned this situation.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use append()
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic