Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt

Class TextArea

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

All Implemented Interfaces:

Serializable, Serializable, ImageObserver, MenuContainer, Serializable


public class TextArea

extends TextComponent

implements Serializable

This implements a multi-line text entry widget.

Author:

Field Summary

static intSCROLLBARS_BOTH

Use both horiztonal and vertical scroll bars.
static intSCROLLBARS_HORIZONTAL_ONLY

Use horizatonal scroll bars only.
static intSCROLLBARS_NONE

Use no scrollbars.
static intSCROLLBARS_VERTICAL_ONLY

Use vertical scroll bars only.

Constructor Summary

TextArea()

Initialize a new instance of TextArea that is empty and is one row and one column.
TextArea(java.lang.String text)

Initializes a new instance of TextArea that contains the specified string.
TextArea(int rows, int columns)

Initializes a new instance of TextArea that is empty and has the specified number of rows and columns.
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.
TextArea(java.lang.String text, int rows, int columns, int scrollbarVisibility)

Initializes a new instance of TextArea with the specified values.

Method Summary

voidaddNotify()

Notify this object that it should create its native peer.
voidappend(java.lang.String str)

Appends the specified text to the end of the current text.
voidappendText(java.lang.String text)

Appends the specified text to the end of the current text.
intgetColumns()

Returns the number of columns in the field.
java.awt.DimensiongetMinimumSize()

Returns the minimum size for this text field.
java.awt.DimensiongetMinimumSize(int rows, int columns)

Returns the minimum size of a text field with the specified number of rows and columns.
java.awt.DimensiongetPreferredSize()

Returns the preferred size for this text field.
java.awt.DimensiongetPreferredSize(int rows, int columns)

Returns the preferred size of a text field with the specified number of rows and columns.
intgetRows()

Returns the number of rows in the field.
intgetScrollbarVisibility()

Returns one of the constants from this class indicating which types of scrollbars this object uses, if any.
voidinsert(java.lang.String text, int pos)

Inserts the specified text at the specified location.
voidinsertText(java.lang.String text, int pos)

Inserts the specified text at the specified location.
java.awt.DimensionminimumSize()

Returns the minimum size for this text field.
java.awt.DimensionminimumSize(int rows, int columns)

Returns the minimum size of a text field with the specified number of rows and columns.
java.lang.StringparamString()

Returns a debugging string for this text area.
java.awt.DimensionpreferredSize()

Returns the preferred size for this text field.
java.awt.DimensionpreferredSize(int rows, int columns)

Returns the preferred size of a text field with the specified number of rows and columns.
voidreplaceRange(java.lang.String text, int start, int end)

Replaces the text bounded by the specified start and end positions with the specified text.
voidreplaceText(java.lang.String text, int start, int end)

Replaces the text bounded by the specified start and end positions with the specified text.
synchronized voidsetColumns(int columns)

Sets the number of columns in this field to the specified value.
synchronized voidsetRows(int rows)

Sets the number of rows in this field to the specified value.

Field Details

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.


Constructor Details

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:


Method Details

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:


getMinimumSize

public Dimension getMinimumSize()

Returns the minimum size for this text field.

Returns:


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:


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:


getScrollbarVisibility

public int getScrollbarVisibility()

Returns one of the constants from this class indicating which types of scrollbars this object uses, if any.

Returns:


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:


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:


preferredSize

public Dimension preferredSize()

Returns the preferred size for this text field.

Returns:


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: