GeezerVison is showing docs.oracle.com — TextArea (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
-
-
Nested Class Summary
Nested Classes
| Modifier and Type |
Class |
Description |
protected class |
TextArea.AccessibleAWTTextArea |
This class implements accessibility support for the
TextArea class.
|
-
Constructor Summary
Constructors
| Constructor |
Description |
TextArea() |
Constructs a new text area with the empty string as text.
|
TextArea(int rows,
int columns) |
Constructs a new text area with the specified number of
rows and columns and the empty string as text.
|
TextArea(String text) |
Constructs a new text area with the specified text.
|
TextArea(String text,
int rows,
int columns) |
Constructs a new text area with the specified text,
and with the specified number of rows and columns.
|
TextArea(String text,
int rows,
int columns,
int scrollbars) |
Constructs a new text area with the specified text,
and with the rows, columns, and scroll bar visibility
as specified.
|
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods
| Modifier and Type |
Method |
Description |
void |
addNotify() |
Creates the TextArea's peer.
|
void |
append(String str) |
Appends the given text to the text area's current text.
|
void |
appendText(String str) |
Deprecated.
As of JDK version 1.1,
replaced by append(String).
|
AccessibleContext |
getAccessibleContext() |
Returns the AccessibleContext associated with
this TextArea.
|
int |
getColumns() |
Returns the number of columns in this text area.
|
Dimension |
getMinimumSize() |
Determines the minimum size of this text area.
|
Dimension |
getMinimumSize(int rows,
int columns) |
Determines the minimum size of a text area with the specified
number of rows and columns.
|
Dimension |
getPreferredSize() |
Determines the preferred size of this text area.
|
Dimension |
getPreferredSize(int rows,
int columns) |
Determines the preferred size of a text area with the specified
number of rows and columns.
|
int |
getRows() |
Returns the number of rows in the text area.
|
int |
getScrollbarVisibility() |
Returns an enumerated value that indicates which scroll bars
the text area uses.
|
void |
insert(String str,
int pos) |
Inserts the specified text at the specified position
in this text area.
|
void |
insertText(String str,
int pos) |
Deprecated.
As of JDK version 1.1,
replaced by insert(String, int).
|
Dimension |
minimumSize() |
Deprecated.
As of JDK version 1.1,
replaced by getMinimumSize().
|
Dimension |
minimumSize(int rows,
int columns) |
Deprecated.
As of JDK version 1.1,
replaced by getMinimumSize(int, int).
|
protected String |
paramString() |
Returns a string representing the state of this TextArea.
|
Dimension |
preferredSize() |
Deprecated.
As of JDK version 1.1,
replaced by getPreferredSize().
|
Dimension |
preferredSize(int rows,
int columns) |
Deprecated.
As of JDK version 1.1,
replaced by getPreferredSize(int, int).
|
void |
replaceRange(String str,
int start,
int end) |
Replaces text between the indicated start and end positions
with the specified replacement text.
|
void |
replaceText(String str,
int start,
int end) |
Deprecated.
As of JDK version 1.1,
replaced by replaceRange(String, int, int).
|
void |
setColumns(int columns) |
Sets the number of columns for this text area.
|
void |
setRows(int rows) |
Sets the number of rows for this text area.
|
-
Methods inherited from class java.awt.TextComponent
addTextListener, enableInputMethods, getBackground, getCaretPosition, getInputMethodRequests, getListeners, getSelectedText, getSelectionEnd, getSelectionStart, getText, getTextListeners, isEditable, processEvent, processTextEvent, removeNotify, removeTextListener, select, selectAll, setBackground, setCaretPosition, setEditable, setSelectionEnd, setSelectionStart, setText
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, prepareImage, prepareImage, print, printAll, 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, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
-
-
Method Detail
-
insertText
@Deprecated
public void insertText(String str,
int pos)
Deprecated. As of JDK version 1.1,
replaced by insert(String, int).
-
appendText
@Deprecated
public void appendText(String str)
Deprecated. As of JDK version 1.1,
replaced by append(String).
-
replaceText
@Deprecated
public void replaceText(String str,
int start,
int end)
Deprecated. As of JDK version 1.1,
replaced by replaceRange(String, int, int).
-
getPreferredSize
public Dimension getPreferredSize(int rows,
int columns)
Determines the preferred size of a text area with the specified
number of rows and columns.
- Parameters:
rows - the number of rows
columns - the number of columns
- Returns:
- the preferred dimensions required to display
the text area with the specified
number of rows and columns
- Since:
- JDK1.1
- See Also:
Component.getPreferredSize()
-
preferredSize
@Deprecated
public Dimension preferredSize(int rows,
int columns)
Deprecated. As of JDK version 1.1,
replaced by getPreferredSize(int, int).
-
getMinimumSize
public Dimension getMinimumSize(int rows,
int columns)
Determines the minimum size of a text area with the specified
number of rows and columns.
- Parameters:
rows - the number of rows
columns - the number of columns
- Returns:
- the minimum dimensions required to display
the text area with the specified
number of rows and columns
- Since:
- JDK1.1
- See Also:
Component.getMinimumSize()
-
minimumSize
@Deprecated
public Dimension minimumSize(int rows,
int columns)
Deprecated. As of JDK version 1.1,
replaced by getMinimumSize(int, int).
-
paramString
protected String paramString()
Returns a string representing the state of this 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.
- Overrides:
paramString in class TextComponent
- Returns:
- the parameter string of this text area
-
getAccessibleContext
public AccessibleContext getAccessibleContext()
Returns the AccessibleContext associated with
this TextArea. For text areas, the
AccessibleContext takes the form of an
AccessibleAWTTextArea.
A new AccessibleAWTTextArea instance is created if necessary.
- Specified by:
getAccessibleContext in interface Accessible
- Overrides:
getAccessibleContext in class TextComponent
- Returns:
- an
AccessibleAWTTextArea that serves as the
AccessibleContext of this TextArea
- Since:
- 1.3
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|