Showing posts with label select(). Show all posts
Showing posts with label select(). Show all posts

Thursday, 6 March 2014

AWT CONTROLS:TextField

TextField  is subclasses of TextComponent.................

Using a TextField


      A TextField object is a text component that allows for the editing of a single line of text. A scrollable text display object with one row of characters is known as the TextField. 

TextField defines the following constructors:


  •  TextField(): Constructs a new text field.

  •  TextField(int numChars): Constructs a new empty TextField with the specified number of columns.

  •  TextField(String str): Constructs a new text field initialized with the specified text.

  •  TextField(String str, int numChars): Constructs a new text field initialized with the specified text to be displayed, and wide enough to hold the specified number of characters.


TextField defines the following methods:


  • getEchoChar():Gets the character that is to be used for echoing.

                syntax
                    char  getEchoChar()

  •  echoCharIsSet():Indicates whether or not this text field has a character set for echoing.

                syntax
                    boolean echoCharIsSet()