Package java.awt |
![]() Previous |
![]() Java API |
![]() Index |
![]() Next |
public class java.awt.TextComponent extends java.awt.Component { // Methods public String getSelectedText(); public int getSelectionEnd(); public int getSelectionStart(); public String getText(); public boolean isEditable(); protected String paramString(); public void removeNotify(); public void select(int selStart, int selEnd); public void selectAll(); public void setEditable(boolean t); public void setText(String t); }
A text component is the superclass of any component that allows the editing of some text.
public String getSelectedText()Return Value:
Returns the selected text in this text component.
See Also: setText .
public int getSelectionEnd()Return Value:
Returns selected text's end position in this text component.
public int getSelectionStart()Return Value:
Returns the selected text's start position in this text component.
public String getText()Return Value:
Returns the text of this text component.
See Also: setText .
public boolean isEditable()Return Value:
Returns true if this text component is editable; false otherwise.
See Also: setEditable .
protected String paramString()Returns the parameter string representing the state of this text component. This string is useful for debugging.
Return Value:
Returns the parameter string of this text component.
Overrides:
paramString in class Component .
public void removeNotify()Notifies this text component to destroy its peer.
Overrides:
removeNotify in class Component .
public void select(int selStart, int selEnd)Selects the text in this text component found from the specified start (inclusive) index to the specified end index (exclusive).
Parameter Description selStart the start position of the text to select selEnd the end position of the text to select
public void selectAll()Selects all the text in this text component.
public void setEditable(boolean t)If the boolean argument is true, this text component becomes user editable. If the flag is false, the user cannot change the text of this text component.
Parameter Description t a flag indicating whether the text component should become user editable See Also: isEditable .
public void setText(String t)Sets the text of this text component to be the specified text.
Parameter Description t the new text See Also: getText .