java.awt.TextComponent (JDK 1.0)
This class is the superclass of the TextArea and TextField components. It cannot be instantiated itself, but provides methods that are common to these two component types. setEditable() specifies whether the text in the text component is editable or not. getText() returns the text in the component, and setText() specifies text to be displayed. getSelectedText() returns the currently selected text in the text component, and getSelectionStart() and getSelectionEnd() return the extents of the selected region of text. select() and selectAll() select some or all of the text displayed in the text component.
See also TextField and TextArea.
public classTextComponentextends Component { //No Constructor//Protected Instance Variables1.1 protected transient TextListenertextListener; //Public Instance Methods1.1 public voidaddTextListener(TextListenerl); 1.1 public intgetCaretPosition(); public synchronized StringgetSelectedText(); public synchronized intgetSelectionEnd(); public synchronized intgetSelectionStart(); public synchronized StringgetText(); public booleanisEditable(); public voidremoveNotify(); //Overrides Component1.1 public voidremoveTextListener(TextListenerl); public synchronized voidselect(intselectionStart, intselectionEnd); public synchronized voidselectAll(); 1.1 public voidsetCaretPosition(intposition); public synchronized voidsetEditable(booleanb); 1.1 public synchronized voidsetSelectionEnd(intselectionEnd); 1.1 public synchronized voidsetSelectionStart(intselectionStart); public synchronized voidsetText(Stringt); //Protected Instance Methodsprotected StringparamString(); //Overrides Component1.1 protected voidprocessEvent(AWTEvente); //Overrides Component1.1 protected voidprocessTextEvent(TextEvente); }
Hierarchy:
Object->Component(ImageObserver, MenuContainer, Serializable)->TextComponent
Extended By:
TextArea, TextField