public interface TextComponentPeer extends ComponentPeer
TextComponent
.
The peer interfaces are intended only for use in porting
the AWT. They are not intended for use by application
developers, and developers should not implement peers
nor invoke any of the peer methods directly on the peer
instances.DEFAULT_OPERATION, NO_EMBEDDED_CHECK, RESET_OPERATION, SET_BOUNDS, SET_CLIENT_SIZE, SET_LOCATION, SET_SIZE
Modifier and Type | Method and Description |
---|---|
int |
getCaretPosition()
Returns the current caret position.
|
InputMethodRequests |
getInputMethodRequests()
Returns the input method requests.
|
int |
getSelectionEnd()
Returns the end index of the current selection.
|
int |
getSelectionStart()
Returns the start index of the current selection.
|
String |
getText()
Returns the current content of the text component.
|
void |
select(int selStart,
int selEnd)
Selects an area of the text component.
|
void |
setCaretPosition(int pos)
Sets the caret position of the text component.
|
void |
setEditable(boolean editable)
Sets if the text component should be editable or not.
|
void |
setText(String text)
Sets the content for the text component.
|
applyShape, canDetermineObscurity, checkImage, coalescePaintEvent, createBuffers, createImage, createImage, createVolatileImage, destroyBuffers, dispose, flip, getBackBuffer, getColorModel, getFontMetrics, getGraphics, getGraphicsConfiguration, getLocationOnScreen, getMinimumSize, getPreferredSize, handleEvent, handlesWheelScrolling, isFocusable, isObscured, isReparentSupported, layout, paint, prepareImage, print, reparent, requestFocus, setBackground, setBounds, setEnabled, setFont, setForeground, setVisible, setZOrder, updateCursorImmediately, updateGraphicsData
void setEditable(boolean editable)
editable
- true
for editable text components,
false
for non-editable text componentsTextComponent.setEditable(boolean)
String getText()
TextComponent.getText()
void setText(String text)
text
- the content to setTextComponent.setText(String)
int getSelectionStart()
TextComponent.getSelectionStart()
int getSelectionEnd()
TextComponent.getSelectionEnd()
void select(int selStart, int selEnd)
selStart
- the start index of the new selectionselEnd
- the end index of the new selectionTextComponent.select(int, int)
void setCaretPosition(int pos)
pos
- the caret position to setTextComponent.setCaretPosition(int)
int getCaretPosition()
TextComponent.getCaretPosition()
InputMethodRequests getInputMethodRequests()
Dracula Javadoc Sample, Made with Allan Im.