All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.TextComponent

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.TextComponent

public class TextComponent
extends Component
A TextComponent is a component that allows the editing of some text.


Variable Index

 o textListener

Method Index

 o addTextListener(TextListener)
Adds the specified text event listener to recieve text events from this textcomponent.
 o getCaretPosition()
Returns the position of the text insertion caret for the text component.
 o getSelectedText()
Returns the selected text contained in this TextComponent.
 o getSelectionEnd()
Returns the selected text's end position.
 o getSelectionStart()
Returns the selected text's start position.
 o getText()
Returns the text contained in this TextComponent.
 o isEditable()
Returns the boolean indicating whether this TextComponent is editable or not.
 o paramString()
Returns the String of parameters for this TextComponent.
 o processEvent(AWTEvent)
Processes events on this textcomponent.
 o processTextEvent(TextEvent)
Processes text events occurring on this text component by dispatching them to any registered TextListener objects.
 o removeNotify()
Removes the TextComponent's peer.
 o removeTextListener(TextListener)
Removes the specified text event listener so that it no longer receives text events from this textcomponent
 o select(int, int)
Selects the text found between the specified start and end locations.
 o selectAll()
Selects all the text in the TextComponent.
 o setCaretPosition(int)
Sets the position of the text insertion caret for the TextComponent
 o setEditable(boolean)
Sets the specified boolean to indicate whether or not this TextComponent should be editable.
 o setSelectionEnd(int)
Sets the selection end to the specified position.
 o setSelectionStart(int)
Sets the selection start to the specified position.
 o setText(String)
Sets the text of this TextComponent to the specified text.

Variables

 o textListener
Properties Inheritable 
    textListener=TextListener 

Methods

 o removeNotify
    method removeNotify()  public     
Removes the TextComponent's peer. The peer allows us to modify the appearance of the TextComponent without changing its functionality.

Overrides:
removeNotify in class Component
 o setText
    method setText(t=String)  public    protect 
Sets the text of this TextComponent to the specified text.

Parameters:
t - the new text to be set
See Also:
getText
 o getText
    method getText() returns String public    protect 
Returns the text contained in this TextComponent.

See Also:
setText
 o getSelectedText
    method getSelectedText() returns String public    protect 
Returns the selected text contained in this TextComponent.

See Also:
setText
 o isEditable
    method isEditable() returns boolean public     
Returns the boolean indicating whether this TextComponent is editable or not.

See Also:
setEditable
 o setEditable
    method setEditable(b=boolean)  public    protect 
Sets the specified boolean to indicate whether or not this TextComponent should be editable.

Parameters:
b - the boolean to be set
See Also:
isEditable
 o getSelectionStart
    method getSelectionStart() returns int public    protect 
Returns the selected text's start position.

 o setSelectionStart
    method setSelectionStart(selectionStart=int)  public    protect 
Sets the selection start to the specified position. The new starting point is constrained to be before or at the current selection end.

Parameters:
selectionStart - the start position of the text
 o getSelectionEnd
    method getSelectionEnd() returns int public    protect 
Returns the selected text's end position.

 o setSelectionEnd
    method setSelectionEnd(selectionEnd=int)  public    protect 
Sets the selection end to the specified position. The new end point is constrained to be at or after the current selection start.

Parameters:
selectionEnd - the start position of the text
 o select
    method select(selectionStart=int, -
                  selectionEnd=int)  public    protect 
Selects the text found between the specified start and end locations.

Parameters:
selectionStart - the start position of the text
selectionEnd - the end position of the text
 o selectAll
    method selectAll()  public    protect 
Selects all the text in the TextComponent.

 o setCaretPosition
    method setCaretPosition(position=int)  public     
Sets the position of the text insertion caret for the TextComponent

Parameters:
position - the position
Throws: IllegalArgumentException
If position is less than 0.
 o getCaretPosition
    method getCaretPosition() returns int public     
Returns the position of the text insertion caret for the text component.

Returns:
the position of the text insertion caret for the text component.
 o addTextListener
    method addTextListener(l=TextListener)  public     
Adds the specified text event listener to recieve text events from this textcomponent.

Parameters:
l - the text event listener
 o removeTextListener
    method removeTextListener(l=TextListener)  public     
Removes the specified text event listener so that it no longer receives text events from this textcomponent

 o processEvent
    method processEvent(e=AWTEvent)  Inheritable     
Processes events on this textcomponent. If the event is a TextEvent, it invokes the processTextEvent method, else it invokes its superclass's processEvent.

Parameters:
e - the event
Overrides:
processEvent in class Component
 o processTextEvent
    method processTextEvent(e=TextEvent)  Inheritable     
Processes text events occurring on this text component by dispatching them to any registered TextListener objects. NOTE: This method will not be called unless text events are enabled for this component; this happens when one of the following occurs: a) A TextListener object is registered via addTextListener() b) Text events are enabled via enableEvents()

Parameters:
e - the text event
See Also:
enableEvents
 o paramString
    method paramString() returns String Inheritable     
Returns the String of parameters for this TextComponent.

Overrides:
paramString in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index