Class java.awt.TextArea
All Packages    This Package    Previous    Next

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.
Version:
1.14, 08/17/95
Author:
Sami Shaio

Constructor Index

 o TextArea()
Constructs a new TextArea.
 o TextArea(int, int)
Constructs a new 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 the specified number of rows and columns.

Method Index

 o addNotify()
Creates the TextArea's peer.
 o getColumns()
Returns the number of columns in the TextArea.
 o getRows()
Returns the number of rows in the TextArea.
 o insertText(String, int)
Inserts the specified text at the specified position.
 o minimumSize(int, int)
Returns the specified minimum size Dimensions of the TextArea.
 o minimumSize()
Returns the minimum size Dimensions of the TextArea.
 o paramString()
Returns the String of parameters for this TextArea.
 o preferredSize(int, int)
Returns the specified row and column Dimensions of the TextArea.
 o preferredSize()
Returns the preferred size Dimensions of the TextArea.
 o replaceText(String, int, int)
Replaces text from the indicated start to end position with the specified new text.

Constructors

 o TextArea
  public TextArea()
Constructs a new TextArea.

 o TextArea

  public TextArea(int rows,
                  int cols)
Constructs a new TextArea with the specified number of rows and columns.
Parameters:
rows - the number of rows
cols - the number of columns

 o TextArea

  public TextArea(String text)
Constructs a new TextArea with the specified text displayed.
Parameters:
text - the text to be displayed

 o TextArea

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

Methods

 o addNotify
  public synchronized void addNotify()
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 insertText

  public void insertText(String str,
                         int pos)
Inserts the specified text at the specified position.
Parameters:
str - the text to insert.
pos - the position to insert at.
See Also:
setText, replaceText

 o replaceText

  public void replaceText(String str,
                          int start,
                          int end)
Replaces text from the indicated start to end position with the specified new text.
Parameters:
str - the text to use as the replacement.
start - the start position.
end - the end position.
See Also:
insertText, replaceText

 o getRows

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

 o getColumns

  public int getColumns()
Returns the number of columns in the TextArea.

 o preferredSize

  public Dimension preferredSize(int rows,
                                 int cols)
Returns the specified row and column Dimensions of the TextArea.
Parameters:
rows - the preferred rows amount
cols - the preferred columns amount

 o preferredSize

  public Dimension preferredSize()
Returns the preferred size Dimensions of the TextArea.
Overrides:
preferredSize in class Component

 o minimumSize

  public Dimension minimumSize(int rows,
                               int cols)
Returns the specified minimum size Dimensions of the TextArea.
Parameters:
rows - the minimum row size
cols - the minimum column size

 o minimumSize

  public Dimension minimumSize()
Returns the minimum size Dimensions of the TextArea.
Overrides:
minimumSize in class Component

 o paramString

  protected String paramString()
Returns the String of parameters for this TextArea.
Overrides:
paramString in class TextComponent


All Packages    This Package    Previous    Next