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.
-
TextField()
- Constructs a new TextField.
-
TextField(int)
- Constructs a new TextField initialized with the specified columns.
-
TextField(String)
- Constructs a new TextField initialized with the specified text.
-
TextField(String, int)
- Constructs a new TextField initialized with the specified text and columns.
-
addNotify()
- Creates the TextField's peer.
-
echoCharIsSet()
- Returns true if this TextField has a character set for
echoing.
-
getColumns()
- Returns the number of columns in this TextField.
-
getEchoChar()
- Returns the character to be used for echoing.
-
minimumSize(int)
- Returns the minimum size Dimensions needed for this TextField with the specified
amount of columns.
-
minimumSize()
- Returns the minimum size Dimensions needed for this TextField.
-
paramString()
- Returns the String of parameters for this TExtField.
-
preferredSize(int)
- Returns the preferred size Dimensions needed for this TextField with the
specified amount of columns.
-
preferredSize()
- Returns the preferred size Dimensions needed for this TextField.
-
setEchoCharacter(char)
- Sets the echo character for this TextField.
TextField
public TextField()
- Constructs a new TextField.
TextField
public TextField(int cols)
- Constructs a new TextField initialized with the specified columns.
- Parameters:
- cols - the number of columns
TextField
public TextField(String text)
- Constructs a new TextField initialized with the specified text.
- Parameters:
- text - the text to be displayed
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
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
getEchoChar
public char getEchoChar()
- Returns the character to be used for echoing.
- See Also:
- setEchoCharacter, echoCharIsSet
echoCharIsSet
public boolean echoCharIsSet()
- Returns true if this TextField has a character set for
echoing.
- See Also:
- setEchoCharacter, getEchoChar
getColumns
public int getColumns()
- Returns the number of columns in this TextField.
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
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
preferredSize
public Dimension preferredSize()
- Returns the preferred size Dimensions needed for this TextField.
- Overrides:
- preferredSize in class Component
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
minimumSize
public Dimension minimumSize()
- Returns the minimum size Dimensions needed for this TextField.
- Overrides:
- minimumSize in class Component
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