Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JTextArea 1

Status
Not open for further replies.

javaken

Technical User
May 15, 2004
20
BE
Hey,

How to clear the contents of a JTextArea???

Thanks

[pipe]
 

JTextArea jta = //
jta.setText(null);

public void setText(String t)Sets the text of this TextComponent to the specified text. If the text is null or empty, has the effect of simply deleting the old text. When text has been inserted, the resulting caret location is determined by the implementation of the caret class.
This method is thread safe, although most Swing methods are not. Please see Threads and Swing for more information.


Parameters:
t - the new text to be set
See Also:
getText(int, int), DefaultCaret
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top