Class java.awt.TextArea
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.
-
TextArea()
- Constructs a new TextArea.
-
TextArea(int, int)
- Constructs a new TextArea with the specified number of rows and columns.
-
TextArea(String)
- Constructs a new TextArea with the specified text displayed.
-
TextArea(String, int, int)
- Constructs a new TextArea with the specified text and the specified number of rows
and columns.
-
addNotify()
- Creates the TextArea's peer.
-
appendText(String)
- Appends the given text to the end.
-
getColumns()
- Returns the number of columns in the TextArea.
-
getRows()
- Returns the number of rows in the TextArea.
-
insertText(String, int)
- Inserts the specified text at the specified position.
-
minimumSize(int, int)
- Returns the specified minimum size Dimensions of the TextArea.
-
minimumSize()
- Returns the minimum size Dimensions of the TextArea.
-
paramString()
- Returns the String of parameters for this TextArea.
-
preferredSize(int, int)
- Returns the specified row and column Dimensions of the TextArea.
-
preferredSize()
- Returns the preferred size Dimensions of the TextArea.
-
replaceText(String, int, int)
- Replaces text from the indicated start to end position with the specified new text.
TextArea
public TextArea()
- Constructs a new TextArea.
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
TextArea
public TextArea(String text)
- Constructs a new TextArea with the specified text displayed.
- Parameters:
- text - the text to be displayed
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
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
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
appendText
public void appendText(String str)
- Appends the given text to the end.
- Parameters:
- str - the text to insert
- See Also:
- insertText
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
getRows
public int getRows()
- Returns the number of rows in the TextArea.
getColumns
public int getColumns()
- Returns the number of columns in the TextArea.
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
preferredSize
public Dimension preferredSize()
- Returns the preferred size Dimensions of the TextArea.
- Overrides:
- preferredSize in class Component
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
minimumSize
public Dimension minimumSize()
- Returns the minimum size Dimensions of the TextArea.
- Overrides:
- minimumSize in class Component
paramString
protected String paramString()
- Returns the String of parameters for this TextArea.
- Overrides:
- paramString in class TextComponent
All Packages Class Hierarchy This Package Previous Next Index