|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Component
![]()
![]()
![]()
java.awt.TextComponent
![]()
![]()
![]()
java.awt.TextArea
, MenuContainer
, Serializable
, Accessible

public class TextArea

A TextArea object is a multi-line region
that displays text. It can be set to allow editing or
to be read-only.
The following image shows the appearance of a text area:
This text area could be created by the following line of code:
new TextArea("Hello", 5, 40);
| Nested Class Summary | |
|---|---|
protected class |
TextArea.AccessibleAWTTextArea
This class implements accessibility support for the TextArea class. |
Nested classes/interfaces inherited from class java.awt.TextComponent ![]() |
|---|
TextComponent.AccessibleAWTTextComponent |
Nested classes/interfaces inherited from class java.awt.Component ![]() |
|---|
Component.AccessibleAWTComponent |
| Field Summary | |
|---|---|
static int |
SCROLLBARS_BOTH
Create and display both vertical and horizontal scrollbars. |
static int |
SCROLLBARS_HORIZONTAL_ONLY
Create and display horizontal scrollbar only. |
static int |
SCROLLBARS_NONE
Do not create or display any scrollbars for the text area. |
static int |
SCROLLBARS_VERTICAL_ONLY
Create and display vertical scrollbar only. |
Fields inherited from class java.awt.TextComponent ![]() |
|---|
textListener |
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Constructor Summary | |
|---|---|
TextArea
Constructs a new text area with the empty string as text. |
|
TextArea
Constructs a new text area with the specified number of rows and columns and the empty string as text. |
|
TextArea
Constructs a new text area with the specified text. |
|
TextArea
Constructs a new text area with the specified text, and with the specified number of rows and columns. |
|
TextArea
Constructs a new text area with the specified text, and with the rows, columns, and scroll bar visibility as specified. |
|
| Method Summary | |
|---|---|
void |
addNotify
Creates the TextArea's peer. |
void |
append
Appends the given text to the text area's current text. |
void |
appendText
Deprecated. As of JDK version 1.1, replaced by append(String). |
AccessibleContext |
getAccessibleContext
Returns the AccessibleContext associated with
this TextArea. |
int |
getColumns
Returns the number of columns in this text area. |
Dimension |
getMinimumSize
Determines the minimum size of this text area. |
Dimension |
getMinimumSize
Determines the minimum size of a text area with the specified number of rows and columns. |
Dimension |
getPreferredSize
Determines the preferred size of this text area. |
Dimension |
getPreferredSize
Determines the preferred size of a text area with the specified number of rows and columns. |
int |
getRows
Returns the number of rows in the text area. |
int |
getScrollbarVisibility
Returns an enumerated value that indicates which scroll bars the text area uses. |
void |
insert
Inserts the specified text at the specified position in this text area. |
void |
insertText
Deprecated. As of JDK version 1.1, replaced by insert(String, int). |
Dimension |
minimumSize
Deprecated. As of JDK version 1.1, replaced by getMinimumSize(). |
Dimension |
minimumSize
Deprecated. As of JDK version 1.1, replaced by getMinimumSize(int, int). |
protected String |
paramString
Returns a string representing the state of this TextArea. |
Dimension |
preferredSize
Deprecated. As of JDK version 1.1, replaced by getPreferredSize(). |
Dimension |
preferredSize
Deprecated. As of JDK version 1.1, replaced by getPreferredSize(int, int). |
void |
replaceRange
Replaces text between the indicated start and end positions with the specified replacement text. |
void |
replaceText
Deprecated. As of JDK version 1.1, replaced by replaceRange(String, int, int). |
void |
setColumns
Sets the number of columns for this text area. |
void |
setRows
Sets the number of rows for this text area. |
Methods inherited from class java.awt.TextComponent ![]() |
|---|
addTextListener |