Results for TextComponentPeer

Interface TextComponentPeer in Java

January 10, 2019
Interface TextComponentPeer in Java
TextComponentPeer in Java

Interface TextComponentPeer in Java:

The TextComponentPeer interface specifies the methods that all implementation of Abstract Window Toolkit text component must define.

The structure of the TextComponentPeer interface is given as:


public interface java.awt.peer.TextComponentPeer extends
                 java.awt.peer.ComponentPeer{
//method
public abstract int getSelectionEnd();
//returns the end position of the selected text.
public abstract int getSelectionStart()
//returns the start position of the selected text.
public abstract String getText();
//returns the text of this text component.
public abstract void select(int startIndex,int endIndex);
//selects the text in the text component from the startIndex (inclusive) and 
//endIndex(exclusive).
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 non editable so that the users 
//can not change its content.
public abstract void setText(String txt);
//sets the txt to the text component.
}
 


Interface TextComponentPeer in Java Interface TextComponentPeer in Java Reviewed by Animesh Chatterjee on January 10, 2019 Rating: 5
Powered by Blogger.