java.lang.Object | +--java.awt.Component | +--java.awt.TextComponent | +--java.awt.TextArea
Unsafe:
private static Set
backwardTraversalKeys
private static Set
forwardTraversalKeys
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, bufferStrategy, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, focusTraversalKeys, font, foreground, graphicsConfig, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, ignoreRepaint, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, mouseWheelListener, mouseWheelListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowFocusListenerK, windowListenerK, windowStateListenerK, x, y
TextArea()
TextArea(int rows,
int columns)
TextArea(String text,
int rows,
int columns)
TextArea(String text,
int rows,
int columns,
int scrollbars)
void
appendText(String str)
append(String).
AccessibleContext
getAccessibleContext()
AccessibleContext associated with
this TextArea.
Dimension
getMinimumSize(int rows,
int columns)
Dimension
getPreferredSize(int rows,
int columns)
int
getScrollbarVisibility()
void
insert(String str,
int pos)
void
insertText(String str,
int pos)
insert(String, int).
Dimension
minimumSize()
getMinimumSize().
Dimension
minimumSize(int rows,
int columns)
getMinimumSize(int, int).
Dimension
preferredSize()
getPreferredSize().
Dimension
preferredSize(int rows,
int columns)
getPreferredSize(int, int).
void
replaceRange(String str,
int start,
int end)
void
replaceText(String str,
int start,
int end)
replaceRange(String, int, int).
addTextListener, areInputMethodsEnabled, enableInputMethods, eventEnabled, getBackground, getCaretPosition, getCharacterBounds, getIndexAtPoint, getListeners, getSelectedText, getSelectionEnd, getSelectionStart, getText, getTextListeners, isEditable, processEvent, processTextEvent, removeNotify, removeTextListener, select, selectAll, setBackground, setCaretPosition, setEditable, setSelectionEnd, setSelectionStart, setText
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, adjustListeningChildrenOnParent, applyComponentOrientation, areFocusTraversalKeysSet, autoProcessMouseWheel, autoTransferFocus, bounds, checkGD, checkImage, checkImage, checkWindowClosingException, clearCurrentFocusCycleRootOnHide, clearMostRecentFocusOwnerOnHide, coalesceEvents, contains, contains, containsFocus, countHierarchyMembers, createBufferStrategy, createBufferStrategy, createChildHierarchyEvents, createHierarchyEvents, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, dispatchMouseWheelToAncestor, doLayout, enable, enable, enableEvents, eventTypeEnabled, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getAlignmentX, getAlignmentY, getBackBuffer, getBounds, getBounds, getBufferStrategy, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys_NoIDCheck, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initializeFocusTraversalKeys, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFocusTraversableOverridden, isFontSet, isForegroundSet, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, iterate, keyDown, keyUp, layout, lightweightPaint, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, nextFocusHelper, numListening, paint, paintAll, paintHeavyweightComponents, postEvent, postsOldMouseEvents, prepareImage, prepareImage, print, printAll, printHeavyweightComponents, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusHelper, requestFocusInWindow, requestFocusInWindow, resetGC, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys_NoIDCheck, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setGCFromPeer, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocus, transferFocusBackward, transferFocusUpCycle, update, updateCursorImmediately, validate
int rows
TextArea.
This parameter will determine the text area's height.
Guaranteed to be non-negative.
getRows(),
setRows(int)int columns
TextArea.
A column is an approximate average character
width that is platform-dependent.
This parameter will determine the text area's width.
Guaranteed to be non-negative.
setColumns(int),
getColumns()private static final String base
private static int nameCounter
public static final int SCROLLBARS_BOTH
public static final int SCROLLBARS_VERTICAL_ONLY
public static final int SCROLLBARS_HORIZONTAL_ONLY
public static final int SCROLLBARS_NONE
private int scrollbarVisibility
SCROLLBARS_BOTH = both scrollbars.SCROLLBARS_HORIZONTAL_ONLY = Horizontal bar only.SCROLLBARS_VERTICAL_ONLY = Vertical bar only.SCROLLBARS_NONE = No scrollbars.
getScrollbarVisibility()private static Set forwardTraversalKeys
private static Set backwardTraversalKeys
private static final long serialVersionUID
private int textAreaSerializedDataVersion
public TextArea() throws HeadlessException
SCROLLBARS_BOTH, so both vertical and horizontal
scrollbars will be visible for this text area.
java.awt.GraphicsEnvironment#isHeadless()public TextArea(String text) throws HeadlessException
SCROLLBARS_BOTH, so both vertical and horizontal
scrollbars will be visible for this text area.
text - the text to be displayed; if
text is null, the empty
string "" will be displayedjava.awt.GraphicsEnvironment#isHeadless()public TextArea(int rows, int columns) throws HeadlessException
SCROLLBARS_BOTH, so both
vertical and horizontal scrollbars will be visible for this
text area.
rows - the number of rowscolumns - the number of columnsjava.awt.GraphicsEnvironment#isHeadless()public TextArea(String text, int rows, int columns) throws HeadlessException
SCROLLBARS_BOTH, so both
vertical and horizontal scrollbars will be visible for this
text area.
text - the text to be displayed; if
text is null, the empty
string "" will be displayedrows - the number of rowscolumns - the number of columnsjava.awt.GraphicsEnvironment#isHeadless()public TextArea(String text, int rows, int columns, int scrollbars) throws HeadlessException
TextArea constructors defer to
this one.
The TextArea class defines several constants
that can be supplied as values for the
scrollbars argument:
SCROLLBARS_BOTH,
SCROLLBARS_VERTICAL_ONLY,
SCROLLBARS_HORIZONTAL_ONLY,
SCROLLBARS_NONE.
scrollbars argument is invalid and will result in
this text area being created with scrollbar visibility equal to
the default value of SCROLLBARS_BOTH.
text - the text to be displayed; if
text is null, the empty
string "" will be displayedrows - the number of rows; if
rows is less than 0,
rows is set to 0columns - the number of columns; if
columns is less than 0,
columns is set to 0scrollbars - a constant that determines what
scrollbars are created to view the text areajava.awt.GraphicsEnvironment#isHeadless()private static void initIDs()
String constructComponentName()
getName
when the name is null.
constructComponentName in class Componentpublic void addNotify()
TextArea's peer. The peer allows us to modify
the appearance of the TextArea without changing any of its
functionality.
addNotify in class TextComponentjava.awt.TextComponent#removeNotifypublic void insert(String str, int pos)
Note that passing null or inconsistent
parameters is invalid and will result in unspecified
behavior.
str - the non-null text to insertpos - the position at which to insertjava.awt.TextComponent#setText,
java.awt.TextArea#replaceRange,
java.awt.TextArea#appendpublic void insertText(String str, int pos)
insert(String, int).
public void append(String str)
Note that passing null or inconsistent
parameters is invalid and will result in unspecified
behavior.
str - the non-null text to appendjava.awt.TextArea#insertpublic void appendText(String str)
append(String).
public void replaceRange(String str, int start, int end)
Note that passing null or inconsistent
parameters is invalid and will result in unspecified
behavior.
str - the non-null text to use as
the replacementstart - the start positionend - the end positionjava.awt.TextArea#insertpublic void replaceText(String str, int start, int end)
replaceRange(String, int, int).
public int getRows()
setRows(int),
getColumns()public void setRows(int rows)
rows - the number of rowsgetRows(),
setColumns(int)public int getColumns()
setColumns(int),
getRows()public void setColumns(int columns)
columns - the number of columnsgetColumns(),
setRows(int)public int getScrollbarVisibility()
The TextArea class defines four integer constants
that are used to specify which scroll bars are available.
TextArea has one constructor that gives the
application discretion over scroll bars.
java.awt.TextArea#SCROLLBARS_BOTH,
java.awt.TextArea#SCROLLBARS_VERTICAL_ONLY,
java.awt.TextArea#SCROLLBARS_HORIZONTAL_ONLY,
java.awt.TextArea#SCROLLBARS_NONE,
java.awt.TextArea#TextArea(java.lang.String, int, int, int)public Dimension getPreferredSize(int rows, int columns)
rows - the number of rows
java.awt.Component#getPreferredSizepublic Dimension preferredSize(int rows, int columns)
getPreferredSize(int, int).
public Dimension getPreferredSize()
getPreferredSize in class Componentjava.awt.Component#getPreferredSizepublic Dimension preferredSize()
getPreferredSize().
preferredSize in class Componentpublic Dimension getMinimumSize(int rows, int columns)
rows - the number of rows
java.awt.Component#getMinimumSizepublic Dimension minimumSize(int rows, int columns)
getMinimumSize(int, int).
public Dimension getMinimumSize()
getMinimumSize in class Componentjava.awt.Component#getPreferredSizepublic Dimension minimumSize()
getMinimumSize().
minimumSize in class Componentprotected String paramString()
TextArea.
This method is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not be
null.
paramString in class TextComponentprivate void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException, HeadlessException
ClassNotFoundException
IOException
HeadlessExceptionjava.awt.GraphicsEnvironment#isHeadlesspublic AccessibleContext getAccessibleContext()
AccessibleContext associated with
this TextArea. For text areas, the
AccessibleContext takes the form of an
AccessibleAWTTextArea.
A new AccessibleAWTTextArea instance is created if necessary.
getAccessibleContext in interface AccessiblegetAccessibleContext in class TextComponentAccessibleAWTTextArea that serves as the
AccessibleContext of this TextArea