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 empty TextField with the specified number of 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 addActionListener(ActionListener)
Adds the specified action listener to recieve action events from this textfield.
 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 getMinimumSize()
Returns the minimum size Dimensions needed for this TextField.
 o getMinimumSize(int)
Returns the minimum size Dimensions needed for this TextField with the specified amount of columns.
 o getPreferredSize()
Returns the preferred size Dimensions needed for this TextField.
 o getPreferredSize(int)
Returns the preferred size Dimensions needed for this TextField with the specified amount of columns.
 o minimumSize()
Deprecated.
 o minimumSize(int)
Deprecated.
 o paramString()
Returns the String of parameters for this TextField.
 o preferredSize()
Deprecated.
 o preferredSize(int)
Deprecated.
 o processActionEvent(ActionEvent)
Processes action events occurring on this textfield by dispatching them to any registered ActionListener objects.
 o processEvent(AWTEvent)
Processes events on this textfield.
 o removeActionListener(ActionListener)
Removes the specified action listener so that it no longer receives action events from this textfield.
 o setColumns(int)
Sets the number of columns in this TextField.
 o setEchoChar(char)
Sets the echo character for this TextField.
 o setEchoCharacter(char)
Deprecated.

Constructors

 o TextField
    method TextField() public 
Constructs a new TextField.

 o TextField
    method TextField(text=String) public 
Constructs a new TextField initialized with the specified text.

Parameters:
text - the text to be displayed
 o TextField
    method TextField(columns=int) public 
Constructs a new empty TextField with the specified number of columns.

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

Parameters:
text - the text to be displayed
columns - the number of columns

Methods

 o addNotify
    method addNotify()  public     
Creates the TextField's peer. The peer allows us to modify the appearance of the TextField without changing its functionality.

Overrides:
addNotify in class Component
 o getEchoChar
    method getEchoChar() returns char public     
Returns the character to be used for echoing.

See Also:
setEchoChar, echoCharIsSet
 o setEchoChar
    method setEchoChar(c=char)  public     
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 setEchoCharacter
    method setEchoCharacter(c=char)  public     
Note: setEchoCharacter() is deprecated. As of JDK version 1.1, replaced by setEchoChar(char).

 o echoCharIsSet
    method echoCharIsSet() returns boolean public     
Returns true if this TextField has a character set for echoing.

See Also:
setEchoChar, getEchoChar
 o getColumns
    method getColumns() returns int public     
Returns the number of columns in this TextField.

 o setColumns
    method setColumns(columns=int)  public     
Sets the number of columns in this TextField.

Parameters:
columns - the number of columns
Throws: IllegalArgumentException
If columns is less than 0.
 o getPreferredSize
    method getPreferredSize(columns=int) returns Dimension public     
Returns the preferred size Dimensions needed for this TextField with the specified amount of columns.

Parameters:
columns - the number of columns in this TextField
 o preferredSize
    method preferredSize(columns=int) returns Dimension public     
Note: preferredSize() is deprecated. As of JDK version 1.1, replaced by getPreferredSize(int).

 o getPreferredSize
    method getPreferredSize() returns Dimension public     
Returns the preferred size Dimensions needed for this TextField.

Overrides:
getPreferredSize in class Component
 o preferredSize
    method preferredSize() returns Dimension public     
Note: preferredSize() is deprecated. As of JDK version 1.1, replaced by getPreferredSize().

Overrides:
preferredSize in class Component
 o getMinimumSize
    method getMinimumSize(columns=int) returns Dimension public     
Returns the minimum size Dimensions needed for this TextField with the specified amount of columns.

Parameters:
columns - the number of columns in this TextField
 o minimumSize
    method minimumSize(columns=int) returns Dimension public     
Note: minimumSize() is deprecated. As of JDK version 1.1, replaced by getMinimumSize(int).

 o getMinimumSize
    method getMinimumSize() returns Dimension public     
Returns the minimum size Dimensions needed for this TextField.

Overrides:
getMinimumSize in class Component
 o minimumSize
    method minimumSize() returns Dimension public     
Note: minimumSize() is deprecated. As of JDK version 1.1, replaced by getMinimumSize().

Overrides:
minimumSize in class Component
 o addActionListener
    method addActionListener(l=ActionListener)  public     
Adds the specified action listener to recieve action events from this textfield.

Parameters:
l - the action listener
 o removeActionListener
    method removeActionListener(l=ActionListener)  public     
Removes the specified action listener so that it no longer receives action events from this textfield.

Parameters:
l - the action listener
 o processEvent
    method processEvent(e=AWTEvent)  Inheritable     
Processes events on this textfield. If the event is an ActionEvent, it invokes the processActionEvent method, else it invokes its superclass's processEvent.

Parameters:
e - the event
Overrides:
processEvent in class TextComponent
 o processActionEvent
    method processActionEvent(e=ActionEvent)  Inheritable     
Processes action events occurring on this textfield by dispatching them to any registered ActionListener objects. NOTE: This method will not be called unless action events are enabled for this component; this happens when one of the following occurs: a) An ActionListener object is registered via addActionListener() b) Action events are enabled via enableEvents()

Parameters:
e - the action event
See Also:
enableEvents
 o paramString
    method paramString() returns String Inheritable     
Returns the String of parameters for this TextField.

Overrides:
paramString in class TextComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index