public TextField (String text) throws HeadlessException

Constructs a new text field initialized with the specified text.

Parameters:
text    the text to be displayed. If text is null, the empty string "" will be displayed.

Exceptions:
HeadlessException    if GraphicsEnvironment.isHeadless() returns true.

See also:
java.awt.GraphicsEnvironment.isHeadless