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 Swing / AWT / SWT and the fly likes clear JTextArea 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 » Swing / AWT / SWT
Bookmark "clear JTextArea" Watch "clear JTextArea" New topic
Author

clear JTextArea

iyappan sankaran
Ranch Hand

Joined: Aug 11, 2003
Posts: 58
how to clear the content of a JTextArea.
Ben Wood
Ranch Hand

Joined: Aug 14, 2001
Posts: 342
setText("") ?


SCJP 1.4, www.gsi3d.org.uk
Amit Ghai
Ranch Hand

Joined: Mar 24, 2004
Posts: 35
The method clear() Clears the content of the JTextArea.


Reasonable people adapt themselves to the world. Unreasonable people attempt to adapt the world to themselves. All progress, therefore, depends on unreasonable people.
iyappan sankaran
Ranch Hand

Joined: Aug 11, 2003
Posts: 58
is it a method called clear()?
Ben Wood
Ranch Hand

Joined: Aug 14, 2001
Posts: 342
I don't think clear() exists as a method

have you tried my suggestion?
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Originally posted by Amit Ghai:
The method clear() Clears the content of the JTextArea.


No it doesn't. There is no method clear() for the JTextArea, uses Ben's suggestion setText("");
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: clear JTextArea
 
Similar Threads
Creating A 'Create Your Own Adventure' Game In Java
clear JTextArea
Writing to a JTextArea
Java 1.5 StringBuffer/StringBuilder
dealing with setting up text areas