The Text Field Component
A text field is a component used for inputting a small amount of text—it only accepts a single line. It automatically takes care of normal line-editing, as determined by whatever look-and-feel is in effect.
The associated class is JTextField.
For larger amounts of text you should use a text area.
A text field might also be used for displaying a short amount of text—not allowing editing.
The model associated with a text field (or a text area) is a, document model, implementing DocumentModel.
For these components, listeners are usually added to the model, rather than the component itself.