Packages  This Package  Prev  Next  Index  

§3.20 Interface TextComponentPeer

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  (II-§3.6)
{
        // Methods
    public abstract int getSelectionEnd();	§3.20.1
    public abstract int getSelectionStart();	§3.20.2
    public abstract String getText();	§3.20.3
    public abstract void select(int  selStart, int  selEnd);	§3.20.4
    public abstract void setEditable(boolean  editable)	§3.20.5
    public abstract void setText(String  l);	§3.20.6
}

Methods

getSelectionEnd

public abstract int getSelectionEnd()
Returns:
selected text's end position.

getSelectionStart

public abstract int getSelectionStart()
Returns:
selected text's start position.

getText

public abstract String getText()
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.
Parameters:
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.
Parameters:
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.
Parameters:
l - the new text

Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com