All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.TextArea

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.TextComponent
                   |
                   +----java.awt.TextArea

public class TextArea
extends TextComponent
A TextArea object is a multi-line area that displays text. It can be set to allow editing or read-only modes.


Variable Index

 o SCROLLBARS_BOTH
Create and display both vertical and horizontal scrollbars.
 o SCROLLBARS_HORIZONTAL_ONLY
Create and display horizontal scrollbar only.
 o SCROLLBARS_NONE
Do not create or display any scrollbars for the text area.
 o SCROLLBARS_VERTICAL_ONLY
Create and display vertical scrollbar only.

Constructor Index

 o TextArea()
Constructs a new TextArea.
 o TextArea(int, int)
Constructs a new empty TextArea with the specified number of rows and columns.
 o TextArea(String)
Constructs a new TextArea with the specified text displayed.
 o TextArea(String, int, int)
Constructs a new TextArea with the specified text and number of rows and columns.
 o TextArea(String, int, int, int)
Constructs a new TextArea with the specified text and number of rows, columns, and scrollbar visibility.

Method Index

 o addNotify()
Creates the TextArea's peer.
 o append(String)
Appends the given text to the end.
 o appendText(String)
Deprecated.
 o getColumns()
Returns the number of columns in the TextArea.
 o getMinimumSize()
Returns the minimum size Dimensions of the TextArea.
 o getMinimumSize(int, int)
Returns the specified minimum size Dimensions of the TextArea.
 o getPreferredSize()
Returns the preferred size Dimensions of the TextArea.
 o getPreferredSize(int, int)
Returns the specified row and column Dimensions of the TextArea.
 o getRows()
Returns the number of rows in the TextArea.
 o getScrollbarVisibility()
Returns the enumerated value describing which scrollbars the text area has.
 o insert(String, int)
Inserts the specified text at the specified position.
 o insertText(String, int)
Deprecated.
 o minimumSize()
Deprecated.
 o minimumSize(int, int)
Deprecated.
 o paramString()
Returns the String of parameters for this TextArea.
 o preferredSize()
Deprecated.
 o preferredSize(int, int)
Deprecated.
 o replaceRange(String, int, int)
Replaces text from the indicated start to end position with the new text specified.
 o replaceText(String, int, int)
Deprecated.
 o setColumns(int)
Sets the number of columns for this TextArea.
 o setRows(int)
Sets the number of rows for this TextArea.

Variables

 o SCROLLBARS_BOTH
Properties Public Constant 
   SCROLLBARS_BOTH=int 
Create and display both vertical and horizontal scrollbars.

 o SCROLLBARS_VERTICAL_ONLY
Properties Public Constant 
   SCROLLBARS_VERTICAL_ONLY=int 
Create and display vertical scrollbar only.

 o SCROLLBARS_HORIZONTAL_ONLY
Properties Public Constant 
   SCROLLBARS_HORIZONTAL_ONLY=int 
Create and display horizontal scrollbar only.

 o SCROLLBARS_NONE
Properties Public Constant 
   SCROLLBARS_NONE=int 
Do not create or display any scrollbars for the text area.

Constructors

 o TextArea
    method TextArea() public 
Constructs a new TextArea.

 o TextArea
    method TextArea(text=String) public 
Constructs a new TextArea with the specified text displayed.

Parameters:
text - the text to be displayed
 o TextArea
    method TextArea(rows=int, -
                    columns=int) public 
Constructs a new empty TextArea with the specified number of rows and columns.

Parameters:
rows - the number of rows
columns - the number of columns
 o TextArea
    method TextArea(text=String, -
                    rows=int, -
                    columns=int) public 
Constructs a new TextArea with the specified text and number of rows and columns.

Parameters:
text - the text to be displayed
rows - the number of rows
columns - the number of columns
 o TextArea
    method TextArea(text=String, -
                    rows=int, -
                    columns=int, -
                    scrollbars=int) public 
Constructs a new TextArea with the specified text and number of rows, columns, and scrollbar visibility.

Parameters:
text - the text to be displayed
rows - the number of rows
columns - the number of columns
scrollbars - the visibility of scrollbars

Methods

 o addNotify
    method addNotify()  public     
Creates the TextArea's peer. The peer allows us to modify the appearance of the TextArea without changing any of its functionality.

Overrides:
addNotify in class Component
 o insert
    method insert(str=String, -
                  pos=int)  public    protect 
Inserts the specified text at the specified position.

Parameters:
str - the text to insert.
pos - the position at which to insert.
See Also:
setText, replaceRange
 o insertText
    method insertText(str=String, -
                      pos=int)  public     
Note: insertText() is deprecated. As of JDK version 1.1, replaced by insert(String, int).

 o append
    method append(str=String)  public    protect 
Appends the given text to the end.

Parameters:
str - the text to insert
See Also:
insert
 o appendText
    method appendText(str=String)  public     
Note: appendText() is deprecated. As of JDK version 1.1, replaced by append(String).

 o replaceRange
    method replaceRange(str=String, -
                        start=int, -
                        end=int)  public    protect 
Replaces text from the indicated start to end position with the new text specified.

Parameters:
str - the text to use as the replacement.
start - the start position.
end - the end position.
See Also:
insert, replaceRange
 o replaceText
    method replaceText(str=String, -
                       start=int, -
                       end=int)  public     
Note: replaceText() is deprecated. As of JDK version 1.1, replaced by replaceRange(String, int, int).

 o getRows
    method getRows() returns int public     
Returns the number of rows in the TextArea.

 o setRows
    method setRows(rows=int)  public     
Sets the number of rows for this TextArea.

Parameters:
rows - the number of rows
Throws: IllegalArgumentException
If rows is less than 0.
 o getColumns
    method getColumns() returns int public     
Returns the number of columns in the TextArea.

 o setColumns
    method setColumns(columns=int)  public     
Sets the number of columns for this TextArea.

Parameters:
columns - the number of columns
Throws: IllegalArgumentException
If columns is less than 0.
 o getScrollbarVisibility
    method getScrollbarVisibility() returns int public     
Returns the enumerated value describing which scrollbars the text area has.

Returns:
the display policy for the scrollbars
 o getPreferredSize
    method getPreferredSize(rows=int, -
                            columns=int) returns Dimension public     
Returns the specified row and column Dimensions of the TextArea.

Parameters:
rows - the preferred rows amount
columns - the preferred columns amount
 o preferredSize
    method preferredSize(rows=int, -
                         columns=int) returns Dimension public     
Note: preferredSize() is deprecated. As of JDK version 1.1, replaced by getPreferredSize(int, int).

 o getPreferredSize
    method getPreferredSize() returns Dimension public     
Returns the preferred size Dimensions of the TextArea.

Overrides:
getPreferredSize in class Component
 o preferredSize
    method preferredSize() returns Dimension public     
Note: preferredSize() is deprecated. As of JDK version 1.1, replaced by getPreferredSize().

Overrides:
preferredSize in class Component
 o getMinimumSize
    method getMinimumSize(rows=int, -
                          columns=int) returns Dimension public     
Returns the specified minimum size Dimensions of the TextArea.

Parameters:
rows - the minimum row size
columns - the minimum column size
 o minimumSize
    method minimumSize(rows=int, -
                       columns=int) returns Dimension public     
Note: minimumSize() is deprecated. As of JDK version 1.1, replaced by getMinimumSize(int, int).

 o getMinimumSize
    method getMinimumSize() returns Dimension public     
Returns the minimum size Dimensions of the TextArea.

Overrides:
getMinimumSize in class Component
 o minimumSize
    method minimumSize() returns Dimension public     
Note: minimumSize() is deprecated. As of JDK version 1.1, replaced by getMinimumSize().

Overrides:
minimumSize in class Component
 o paramString
    method paramString() returns String Inheritable     
Returns the String of parameters for this TextArea.

Overrides:
paramString in class TextComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index