This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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


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("");
 
GeeCON Prague 2014
 
subject: clear JTextArea