Package java.awt.peer |
![]() Previous |
![]() Java API |
![]() Index |
![]() Next |
The text component peer interface specifies the methods that all implementations of Abstract Window Toolkit text components must define.
public interface java.awt.peer.TextComponentPeer extends java.awt.peer.ComponentPeer { // Methods public abstract int getSelectionEnd(); public abstract int getSelectionStart(); public abstract String getText(); public abstract void select(int selStart, int selEnd); public abstract void setEditable(boolean editable) public abstract void setText(String l); }
public abstract int getSelectionEnd()Return Value:
Returns selected text's end position.
public abstract int getSelectionStart()Return Value:
Returns selected text's start position.
public abstract String getText()Return Value:
Returns the text of this text component.
public abstract void select(int selStart, int selEnd)Selects the text in the text component from the start (inclusive) index to the end (exclusive) index.
Parameter Description selStart the start position of the text to select selEnd the end position of the text to select
public abstract void setEditable(boolean editable)Sets the text component to be user editable if the boolean argument is true. If the flag is false, sets the text component so that the user cannot change its contents.
Parameter Description editable a flag indicating whether the text component should become user editable
public abstract void setText(String l)Sets the text of this text component to the specified text.
Parameter Description l the new text