We need you!

Icon

The IzPack documentation needs work, and you are invited to edit it!

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

A text input field allows the user to enter and edit a single line of text, without length restriction.

...

To specify a text input field create a <field> tag and use the type attribute with a value of text. The txt and id attributes are not supported here. The variable attribute specifies the variable that should be replaced with the text taken from the input field.

Data

The data consists of two items, a description and the spec. The <spec> tag uses four attributes. The label text is specified with txt and/or id as described above. In addition, the width of the input field as it appears on the panel can be set with the size attribute. The value must be an integer and sets the field width based on the average character width of the active font. If this is not specified, then you will end up with a very narrow field that is practically unusable.

The fourth attribute set is optional. It takes a text string to pre-fill the input field.

Example

The following example creates a text input field with a label and description. The width of the input field will be enough to accommodate 15 characters. The field will be pre-set with the text 'some text' when the UI is first presented.

...