This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "setText() problem" Watch "setText() problem" New topic
Author

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()
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: setText() problem
 
Similar Threads
JTextField setText update problem
JTextField does not display in loop until the end
Add event listener.... Help!
problem adding JScrollPane to JTextArea
Erasing existing text