Two Laptop Bag
The moose likes Beginning Java and the fly likes setText() problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "setText() problem" Watch "setText() problem" New topic

setText() problem

Jade Davidson
Ranch Hand

Joined: Oct 12, 2001
Posts: 64
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

Joined: May 17, 2001
Posts: 2823
Use append()
I agree. Here's the link:
subject: setText() problem
It's not a secret anymore!