File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
Similar Threads
Erasing existing text
problem adding JScrollPane to JTextArea
JTextField setText update problem
Add event listener.... Help!
JTextField does not display in loop until the end