Java Reference
In-Depth Information
JTextArea
S e e
JTextComponent
.
JTextComponent
Package:
javax.swing.text
The classes
JTextField
and
JTextArea
are in the package
javax.swing
.
All these methods are inherited by the classes
JTextField
and
JTextArea
.
Ancestor classes:
Object
|
+--Component
|
+--Container
|
+--JComponent
|
+--JTextComponent
| \
+--JTextField +--JTextArea
public
String getText()
Returns the text that is displayed by this text component.
public boolean
isEditable()
Returns
true
if the user can write in this text component. Returns
false
if the user is not
allowed to write in this text component.
public void
setBackground(Color theColor)
Sets the background color of this text component.
public void
setEditable(
boolean
argument)
If
argument
is
true
, then the user is allowed to write in the text component. If
argument
is
false
, then the user is not allowed to write in the text component.
public void
setText(String text)
Sets the text that is displayed by this text component to be the specifi ed
text
.
JTextField
See
JTextComponent
.