The TextArea class provides a multi-line Component for textual user input.
public class java.awt.TextArea extends java.awt.TextComponent { // Constants public final static int SCROLLBARS_BOTH; public final static int SCROLLBARS_HORIZONTAL_ONLY; public final static int SCROLLBARS_NONE; public final static int SCROLLBARS_VERTICAL_ONLY; // Constructors public TextArea(); public TextArea (int rows, int columns); public TextArea (String text); public TextArea (String text, int rows, int columns); public TextArea (String text, int rows, int columns, int scrollbars); // Instance Methods public void addNotify(); public synchronized void append (String string); public void appendText (String string); public int getColumns(); public Dimension getMinimumSize(); public Dimension getMinimumSize (int rows, int columns); public Dimension getPreferredSize(); public Dimension getPreferredSize (int rows, int columns); public int getRows(); public int getScrollbarVisibility(); public synchronized void insert (String string, int position); public void insertText (String string, int position); public Dimension minimumSize(); public Dimension minimumSize (int rows, int columns); public Dimension preferredSize(); public Dimension preferredSize (int rows, int columns); public synchronized void replaceRange (String str, int start, int end); public void replaceText (String string, int startPosition, int endPosition); public void setColumns (int columns); public void setRows (int rows); // Protected Instance Methods protected String paramString(); }
Show both the horizontal and vertical scrollbars.
Show the horizontal scrollbar.
Show no scrollbars.
Show the vertical scrollbar.
Constructs a TextArea object with the default size and no initial content. The default size of a text area varies widely from platform to platform, so it's best to avoid this constructor.
Requested number of displayed rows.
Requested number of displayed columns.
Constructs a TextArea object of the given size and no initial content.
Initial text for TextArea.
Constructs a TextArea object with the given initial content.
Initial text for TextArea.
Requested number of displayed rows.
Requested number of displayed columns.
Constructs a TextArea object with the given content and size.
Initial text for TextArea.
Requested number of displayed rows.
Requested number of displayed columns.
Requested scrollbar visibility. Use one of the constants defined.
Constructs a TextArea object with the given content, size, and scrollbar visibility.
Component.addNotify()
Creates TextArea's peer.
Content to append to the end of the TextArea.
Appends the given text string to the text already displayed in the TextArea.
Content to append to end of TextArea.
Replaced by append(String).
The width of the TextArea in columns.
The minimum dimensions of the TextArea.
Number of rows within TextArea to size.
Number of columns within TextArea to size.
The minimum dimensions of a TextArea of the given size.
The preferred dimensions of the TextArea.
Number of rows within TextArea to size.
Number of columns within TextArea to size.
The preferred dimensions of a TextArea of the given size.
The height of the TextArea in rows.
One of the SCROLLBAR_ constants indicating which scrollbars are visible.
Content to place within TextArea content.
Location to insert content.
Places additional text within the TextArea at the given position.
Content to place within TextArea content.
Location to insert content.
Places additional text within the TextArea at the given position. Replaced by insert(String, int).
The minimum dimensions of the TextArea. Replaced by getMinimumSize().
Number of rows within TextArea to size.
Number of columns within TextArea to size.
The minimum dimensions of a TextArea of the given size. Replaced by getMinimumSize(int, int).
The preferred dimensions of the TextArea. Replaced by getPreferredSize().
Number of rows within TextArea to size.
Number of columns within TextArea to size.
The preferred dimensions of a TextArea of the given size. Replaced by getPreferredSize(int, int).
New content to place in TextArea.
Starting position of content to replace.
Ending position of content to replace.
Replaces a portion of the TextArea's content with the given text.
New content to place in TextArea.
Starting position of content to replace.
Ending position of content to replace.
Replaces a portion of the TextArea's content with the given text. Replaced by replaceRange(String, int, int).
New number of columns.
If columns is less than zero.
Changes the number of columns.
New number of columns.
If rows is less than zero.
Changes the number of rows.
String with current settings of TextArea.
TextComponent.paramString()
Helper method for toString() to generate string of current settings.
Dimension, TextComponent, String