Class java.awt.TextField
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.TextField

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

public class TextField
extends TextComponent
TextField is a component that allows the editing of a single line of text.

Constructor Index

 o TextField()
Constructs a new TextField.
 o TextField(int)
Constructs a new TextField initialized with the specified columns.
 o TextField(String)
Constructs a new TextField initialized with the specified text.
 o TextField(String, int)
Constructs a new TextField initialized with the specified text and columns.

Method Index

 o addNotify()
Creates the TextField's peer.
 o echoCharIsSet()
Returns true if this TextField has a character set for echoing.
 o getColumns()
Returns the number of columns in this TextField.
 o getEchoChar()
Returns the character to be used for echoing.
 o minimumSize(int)
Returns the minimum size Dimensions needed for this TextField with the specified amount of columns.
 o minimumSize()
Returns the minimum size Dimensions needed for this TextField.
 o paramString()
Returns the String of parameters for this TExtField.
 o preferredSize(int)
Returns the preferred size Dimensions needed for this TextField with the specified amount of columns.
 o preferredSize()
Returns the preferred size Dimensions needed for this TextField.
 o setEchoCharacter(char)
Sets the echo character for this TextField.

Constructors

 o TextField
  public TextField()
Constructs a new TextField.
 o TextField
  public TextField(int cols)
Constructs a new TextField initialized with the specified columns.
Parameters:
cols - the number of columns
 o TextField
  public TextField(String text)
Constructs a new TextField initialized with the specified text.
Parameters:
text - the text to be displayed
 o TextField
  public TextField(String text,
                   int cols)
Constructs a new TextField initialized with the specified text and columns.
Parameters:
text - the text to be displayed
cols - the number of columns

Methods

 o addNotify
  public synchronized void addNotify()
Creates the TextField's peer. The peer allows us to modify the appearance of the TextField without canging its functionality.
Overrides:
addNotify in class Component
 o getEchoChar
  public char getEchoChar()
Returns the character to be used for echoing.
See Also:
setEchoCharacter, echoCharIsSet
 o echoCharIsSet
  public boolean echoCharIsSet()
Returns true if this TextField has a character set for echoing.
See Also:
setEchoCharacter, getEchoChar
 o getColumns
  public int getColumns()
Returns the number of columns in this TextField.
 o setEchoCharacter
  public void setEchoCharacter(char c)
Sets the echo character for this TextField. This is useful for fields where the user input shouldn't be echoed to the screen, as in the case of a TextField that represents a password.
Parameters:
c - the echo character for this TExtField
See Also:
echoCharIsSet, getEchoChar
 o preferredSize
  public Dimension preferredSize(int cols)
Returns the preferred size Dimensions needed for this TextField with the specified amount of columns.
Parameters:
cols - the number of columns in this TextField
 o preferredSize
  public Dimension preferredSize()
Returns the preferred size Dimensions needed for this TextField.
Overrides:
preferredSize in class Component
 o minimumSize
  public Dimension minimumSize(int cols)
Returns the minimum size Dimensions needed for this TextField with the specified amount of columns.
Parameters:
cols - the number of columns in this TextField
 o minimumSize
  public Dimension minimumSize()
Returns the minimum size Dimensions needed for this TextField.
Overrides:
minimumSize in class Component
 o paramString
  protected String paramString()
Returns the String of parameters for this TExtField.
Overrides:
paramString in class TextComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index