|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.TextComponent | +--java.awt.TextArea
A TextArea object is a multi-line area that displays text. It can be set to allow editing or read-only modes.
Field Summary |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
TextArea()
Constructs a new TextArea. |
|
TextArea(int rows,
int cols)
Constructs a new TextArea with the specified number of rows and columns. |
|
TextArea(String text)
Constructs a new TextArea with the specified text displayed. |
|
TextArea(String text,
int rows,
int cols)
Constructs a new TextArea with the specified text and number of rows and columns. |
Method Summary | |
void |
addNotify()
Creates the TextArea's peer. |
void |
appendText(String str)
Appends the given text to the end. |
int |
getColumns()
Returns the number of columns in the TextArea. |
int |
getRows()
Returns the number of rows in the TextArea. |
void |
insertText(String str,
int pos)
Inserts the specified text at the specified position. |
Dimension |
minimumSize()
Returns the minimum size Dimensions of the TextArea. |
Dimension |
minimumSize(int rows,
int cols)
Returns the specified minimum size Dimensions of the TextArea. |
protected String |
paramString()
Returns the String of parameters for this TextArea. |
Dimension |
preferredSize()
Returns the preferred size Dimensions of the TextArea. |
Dimension |
preferredSize(int rows,
int cols)
Returns the specified row and column Dimensions of the TextArea. |
void |
replaceText(String str,
int start,
int end)
Replaces text from the indicated start to end position with the new text specified. |
Methods inherited from class java.awt.TextComponent |
getSelectedText, getSelectionEnd, getSelectionStart, getText, isEditable, removeNotify, select, selectAll, setEditable, setText |
Methods inherited from class java.awt.Component |
action, bounds, checkImage, checkImage, createImage, createImage, deliverEvent, disable, enable, enable, getBackground, getColorModel, getFont, getFontMetrics, getForeground, getGraphics, getParent, getPeer, getToolkit, gotFocus, handleEvent, hide, imageUpdate, inside, invalidate, isEnabled, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, prepareImage, prepareImage, print, printAll, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setFont, setForeground, show, show, size, toString, update, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TextArea()
public TextArea(int rows, int cols)
rows
- the number of rowscols
- the number of columnspublic TextArea(String text)
text
- the text to be displayedpublic TextArea(String text, int rows, int cols)
text
- the text to be displayedrows
- the number of rowscols
- the number of colsMethod Detail |
public void addNotify()
addNotify
in class Component
Component.getPeer()
,
Component.removeNotify()
public void insertText(String str, int pos)
str
- the text to insert.pos
- the position at which to insert.TextComponent.setText(java.lang.String)
,
replaceText(java.lang.String, int, int)
public void appendText(String str)
str
- the text to insertinsertText(java.lang.String, int)
public void replaceText(String str, int start, int end)
str
- the text to use as the replacement.start
- the start position.end
- the end position.insertText(java.lang.String, int)
,
replaceText(java.lang.String, int, int)
public int getRows()
public int getColumns()
public Dimension preferredSize(int rows, int cols)
rows
- the preferred rows amountcols
- the preferred columns amountpublic Dimension preferredSize()
preferredSize
in class Component
Component.minimumSize()
,
LayoutManager
public Dimension minimumSize(int rows, int cols)
rows
- the minimum row sizecols
- the minimum column sizepublic Dimension minimumSize()
minimumSize
in class Component
Component.preferredSize()
,
LayoutManager
protected String paramString()
paramString
in class TextComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |