Java java.awt TextField fields, constructors, methods, implement or subclass

Example usage for Java java.awt TextField fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.awt TextField.

The text is from its open source code.

Subclass

java.awt.TextField has subclasses.
Click this link to see all its subclasses.

Constructor

TextField(String text)
Constructs a new text field initialized with the specified text.
TextField(int columns)
Constructs a new empty text field with the specified number of columns.
TextField(String text, int columns)
Constructs a new text field initialized with the specified text to be displayed, and wide enough to hold the specified number of columns.
TextField()
Constructs a new text field.

Method

voidaddKeyListener(KeyListener l)
Adds the specified key listener to receive key events from this component.
DimensiongetPreferredSize()
Gets the preferred size of this text field.
StringgetText()
Returns the text that is presented by this text component.
voidsetBackground(Color c)
Sets the background color of this text component.
voidsetBounds(int x, int y, int width, int height)
Moves and resizes this component.
voidsetEditable(boolean b)
Sets the flag that determines whether or not this text component is editable.
voidsetLocation(int x, int y)
Moves this component to a new location.
voidsetText(String t)
Sets the text that is presented by this text component to be the specified text.
voidvalidate()
Validates this component.