Package java.awt.peer Previous
Previous
Java API
Java API
Index
Index
Next
Next

Interface TextComponentPeer

Methods

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);	
}


Methods


getSelectionEnd

public abstract int getSelectionEnd() 

Return Value:

Returns selected text's end position.


getSelectionStart

public abstract int getSelectionStart() 

Return Value:

Returns selected text's start position.


getText

public abstract String getText() 

Return Value:

Returns the text of this text component.


select

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.

ParameterDescription
selStart the start position of the text to select
selEnd the end position of the text to select


setEditable

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.

ParameterDescription
editable a flag indicating whether the text component should become user editable


setText

public abstract void setText(String  l) 

Sets the text of this text component to the specified text.

ParameterDescription
l the new text



Top© 1996 Sun Microsystems, Inc. All rights reserved.