APIdia Launch Partner
Top Description Fields Methods
java.awt.peer

public Interface TextComponentPeer

extends ComponentPeer
Known Direct Subinterfaces
java.awt.peer.TextFieldPeer, java.awt.peer.TextAreaPeer
Imports
java.awt.TextComponent, java.awt.im.InputMethodRequests

The peer interface for 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.

Field Summary

Inherited from java.awt.peer.ComponentPeer:
DEFAULT_OPERATIONNO_EMBEDDED_CHECKRESET_OPERATIONSET_BOUNDSSET_CLIENT_SIZESET_LOCATIONSET_SIZE

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the current caret position
getCaretPosition
()

Returns the current caret position.

public InputMethodRequests

Returns:

the input method requests
getInputMethodRequests
()

Returns the input method requests.

public int

Returns:

the end index of the current selection
getSelectionEnd
()

Returns the end index of the current selection.

public int

Returns:

the start index of the current selection
getSelectionStart
()

Returns the start index of the current selection.

public String

Returns:

the current content of the text component
getText
()

Returns the current content of the text component.

public void
select(int
the start index of the new selection
selStart
,
int
the end index of the new selection
selEnd
)

Selects an area of the text component.

public void
setCaretPosition(int
the caret position to set
pos
)

Sets the caret position of the text component.

public void
setEditable(boolean
true for editable text components, false for non-editable text components
editable
)

Sets if the text component should be editable or not.

public void
setText(String
the content to set
text
)

Sets the content for the text component.

Inherited from java.awt.peer.ComponentPeer:
applyShapecanDetermineObscuritycoalescePaintEventcreateBufferscreateImagecreateVolatileImagedestroyBuffersdisposeflipgetBackBuffergetColorModelgetFontMetricsgetGraphicsgetGraphicsConfigurationgetLocationOnScreengetMinimumSizegetPreferredSizehandleEventhandlesWheelScrollingisFocusableisObscuredisReparentSupportedlayoutpaintprintreparentrequestFocussetBackgroundsetBoundssetEnabledsetFontsetForegroundsetVisiblesetZOrderupdateCursorImmediatelyupdateGraphicsData

Method Detail

getCaretPositionback to summary
public int getCaretPosition()

Returns the current caret position.

Returns:int

the current caret position

See Also
TextComponent#getCaretPosition()
getInputMethodRequestsback to summary
public InputMethodRequests getInputMethodRequests()

Returns the input method requests.

Returns:InputMethodRequests

the input method requests

getSelectionEndback to summary
public int getSelectionEnd()

Returns the end index of the current selection.

Returns:int

the end index of the current selection

See Also
TextComponent#getSelectionEnd()
getSelectionStartback to summary
public int getSelectionStart()

Returns the start index of the current selection.

Returns:int

the start index of the current selection

See Also
TextComponent#getSelectionStart()
getTextback to summary
public String getText()

Returns the current content of the text component.

Returns:String

the current content of the text component

See Also
TextComponent#getText()
selectback to summary
public void select(int selStart, int selEnd)

Selects an area of the text component.

Parameters
selStart:int

the start index of the new selection

selEnd:int

the end index of the new selection

See Also
TextComponent#select(int, int)
setCaretPositionback to summary
public void setCaretPosition(int pos)

Sets the caret position of the text component.

Parameters
pos:int

the caret position to set

See Also
TextComponent#setCaretPosition(int)
setEditableback to summary
public void setEditable(boolean editable)

Sets if the text component should be editable or not.

Parameters
editable:boolean

true for editable text components, false for non-editable text components

See Also
TextComponent#setEditable(boolean)
setTextback to summary
public void setText(String text)

Sets the content for the text component.

Parameters
text:String

the content to set

See Also
TextComponent#setText(String)