Class awt.TextField
All Packages    This Package    Previous    Next

Class awt.TextField

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

public class TextField
extends Component
TextField is a gui element that allows a single line of text input.
Version:
1.20 17 Feb 1995
Author:
Sami Shaio

echoChar
echoSet

TextField(String, String, Container, boolean)
Constructs a TextField.

dispose()
Disposes of this TextField rendering it useless.
getPreferredSize()
Returns the preferred size of this TextField.
getText()
Returns the text contained in this TextField.
map()
Shows this TextField.
move(int, int)
Moves this TextField to x,y
reshape(int, int, int, int)
Reshapes this TextField to the given dimensions.
selected()
Override this method to take action when the user hits return after entering a value in the TextField.
setColor(Color)
Sets the color of this TextField.
setEchoCharacter(char)
Sets the echo character for this TextField.
setEditable(boolean)
Sets whether or not this TextField should be editable.
setFont(Font)
Sets the font for this TextField.
setHFill(boolean)
If t is true then this TextField will stretch horizontally to the width of its container.
setText(String)
Sets the text of this TextField.
unMap()
Hides this TextField.

echoSet
  public boolean echoSet
echoChar
  public char echoChar

TextField
  public TextField(String initValue,
                   String pName,
                   Container p,
                   boolean editable)
Constructs a TextField.
Parameters:
initValue - is the initial value of the field. It may be null.
pName - is the name of this component.
p - is the parent window of this TextField.
editable - is true if this TextField shoud allow editing.

setHFill
  public void setHFill(boolean t)
If t is true then this TextField will stretch horizontally to the width of its container.

setFont

  public void setFont(Font f)
Sets the font for this TextField.

setColor

  public void setColor(Color c)
Sets the color of 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 is the case for a TextField that represents a password.

setEditable

  public void setEditable(boolean t)
Sets whether or not this TextField should be editable.

setText

  public void setText(String t)
Sets the text of this TextField.

getText

  public String getText()
Returns the text contained in this TextField.

dispose

  public void dispose()
Disposes of this TextField rendering it useless.
Overrides:
dispose in class Component

move

  public void move(int x,
                   int y)
Moves this TextField to x,y
Overrides:
move in class Component

reshape

  public void reshape(int x,
                      int y,
                      int w,
                      int h)
Reshapes this TextField to the given dimensions.
Overrides:
reshape in class Component

getPreferredSize

  public Dimension getPreferredSize()
Returns the preferred size of this TextField.
Overrides:
getPreferredSize in class Component

map

  public void map()
Shows this TextField.
Overrides:
map in class Component

unMap

  public void unMap()
Hides this TextField.
Overrides:
unMap in class Component

selected

  public void selected()
Override this method to take action when the user hits return after entering a value in the TextField.


All Packages    This Package    Previous    Next