Adding Text Fields

You can add two types of text fields to your layout:

The text fields can be used to obtain user input and/or to display text generated by the application.

To add a text field to the layout:

  1. Click on either the Single-line TextField or Multi-line TextField component in the AWT palette tab.
  2. Click in the cell where you want to place the component.
  3. Open the attribute editor by clicking on its button in the main toolbar.
  4. Type a unique component ID in the name text field.
Text that you enter in the attribute editor's text box is displayed in the component as a default text each time the layout is opened.

Special Attributes

echoCharacter Returns the character used in concealing input, such as a password. (Not an attribute of Multi-Line TextField)
editable Sets the field to be writable by the user.
numColumns Sets the minimum width of the field to accommodate the specified number of characters.
numRows Sets the minimum height of the field to accommodate the specified number of rows.

See also:

Laying Out the Interface
Generating Java Source Code
Adding Operations to Components
GUI Builder Palette

Visual Java GUI Builder API Documentation
Visual Java GUI Builder Runtime Packages
Class Hierarchy
Index of All Fields and Methods