java.awt
Class TextArea
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.TextComponent
|
+--java.awt.TextArea
All Implemented Interfaces:
Serializable, Serializable, ImageObserver, MenuContainer, Serializable
This implements a multi-line text entry widget.
Author:- Aaron M. Renn (arenn@urbanophile.com)
void | addNotify()
|
void | append(java.lang.String str)
|
void | appendText(java.lang.String text)
|
int | getColumns()
|
java.awt.Dimension | getMinimumSize()
|
java.awt.Dimension | getMinimumSize(int rows, int columns)
|
java.awt.Dimension | getPreferredSize()
|
java.awt.Dimension | getPreferredSize(int rows, int columns)
|
int | getRows()
|
int | getScrollbarVisibility()
|
void | insert(java.lang.String text, int pos)
|
void | insertText(java.lang.String text, int pos)
|
java.awt.Dimension | minimumSize()
|
java.awt.Dimension | minimumSize(int rows, int columns)
|
java.lang.String | paramString()
|
java.awt.Dimension | preferredSize()
|
java.awt.Dimension | preferredSize(int rows, int columns)
|
void | replaceRange(java.lang.String text, int start, int end)
|
void | replaceText(java.lang.String text, int start, int end)
|
synchronized void | setColumns(int columns)
|
synchronized void | setRows(int rows)
|
SCROLLBARS_BOTH
public static final int SCROLLBARS_BOTH
Use both horiztonal and vertical scroll bars.
SCROLLBARS_HORIZONTAL_ONLY
public static final int SCROLLBARS_HORIZONTAL_ONLY
Use horizatonal scroll bars only.
SCROLLBARS_NONE
public static final int SCROLLBARS_NONE
Use no scrollbars.
SCROLLBARS_VERTICAL_ONLY
public static final int SCROLLBARS_VERTICAL_ONLY
Use vertical scroll bars only.
TextArea
public TextArea()
Initialize a new instance of TextArea
that is empty
and is one row and one column. Both horizontal and vertical
scrollbars will be used.
Throws:
TextArea
public TextArea(int rows, int columns)
Initializes a new instance of TextArea
that is empty
and has the specified number of rows and columns. Both
horizontal and vertical scrollbars will be used.
Parameters:
Throws:
TextArea
public TextArea(java.lang.String text)
Initializes a new instance of TextArea
that
contains the specified string. Both horizontal and veritcal
scrollbars will be used.
Parameters:
Throws:
TextArea
public TextArea(java.lang.String text, int rows, int columns)
Initializes a new instance of TextArea
that is the
specified size and has the specified text.
Parameters:
Throws:
TextArea
public TextArea(java.lang.String text, int rows, int columns, int scrollbarVisibility)
Initializes a new instance of TextArea
with the
specified values. The scrollbar visibility value must be one
of the constants in this class.
Parameters:
Throws:
addNotify
public void addNotify()
Notify this object that it should create its native peer.
append
public void append(java.lang.String str)
Appends the specified text to the end of the current text.
Parameters:
appendText
public void appendText(java.lang.String text)
Appends the specified text to the end of the current text.
Parameters:
getColumns
public int getColumns()
Returns the number of columns in the field.
Returns:
- The number of columns in the field.
getMinimumSize
public Dimension getMinimumSize()
Returns the minimum size for this text field.
Returns:
- The minimum size for this text field.
getMinimumSize
public Dimension getMinimumSize(int rows, int columns)
Returns the minimum size of a text field with the specified number
of rows and columns.
Parameters:
getPreferredSize
public Dimension getPreferredSize()
Returns the preferred size for this text field.
Returns:
- The preferred size for this text field.
getPreferredSize
public Dimension getPreferredSize(int rows, int columns)
Returns the preferred size of a text field with the specified number
of rows and columns.
Parameters:
getRows
public int getRows()
Returns the number of rows in the field.
Returns:
- The number of rows in the field.
getScrollbarVisibility
public int getScrollbarVisibility()
Returns one of the constants from this class indicating which
types of scrollbars this object uses, if any.
Returns:
- The scrollbar type constant for this object.
insert
public void insert(java.lang.String text, int pos)
Inserts the specified text at the specified location.
Parameters:
insertText
public void insertText(java.lang.String text, int pos)
Inserts the specified text at the specified location.
Parameters:
minimumSize
public Dimension minimumSize()
Returns the minimum size for this text field.
Returns:
- The minimum size for this text field.
minimumSize
public Dimension minimumSize(int rows, int columns)
Returns the minimum size of a text field with the specified number
of rows and columns.
Parameters:
paramString
protected String paramString()
Returns a debugging string for this text area.
Returns:
- A debugging string for this text area.
preferredSize
public Dimension preferredSize()
Returns the preferred size for this text field.
Returns:
- The preferred size for this text field.
preferredSize
public Dimension preferredSize(int rows, int columns)
Returns the preferred size of a text field with the specified number
of rows and columns.
Parameters:
replaceRange
public void replaceRange(java.lang.String text, int start, int end)
Replaces the text bounded by the specified start and end positions
with the specified text.
Parameters:
replaceText
public void replaceText(java.lang.String text, int start, int end)
Replaces the text bounded by the specified start and end positions
with the specified text.
Parameters:
setColumns
public synchronized void setColumns(int columns)
Sets the number of columns in this field to the specified value.
Parameters:
Throws:
setRows
public synchronized void setRows(int rows)
Sets the number of rows in this field to the specified value.
Parameters:
Throws: