If a MIDlet requires having several UI components on the screen at the
same time, they can be implemented using Form
s.
In a similar way to other high-level APIs, Form
s also
take up the whole display area but in that area they can contain a number
of different UI elements, for example sliders, pop-up lists and text fields. Form
s
offer a way to handle data and user input in a more complex way.
All Form
elements are derived from the superclass Item
.
The Form
Item
s are presented in
the main pane, which can be scrolled vertically if all the components do not
fit otherwise. Text is wrapped and images are clipped if the content exceeds
the horizontal space. Items are laid out to the main pane from top to bottom
and left to right, by default. An Item
is focused when
the user has navigated to it using the arrow keys and a highlight box indicates
the Item
has been focused on. Items
can
be editable or non-editable. All Item
s have a label,
which is null
by default. If an item has a label, it
is displayed on a line below the rest of the item.
All editing in a Form
takes place inline and all
editable Item
s are focusable. Also the non-editable Item
s StringItem
and ImageItem
can be focusable if there are one or more Command
s
set to them and ItemCommandListener
is registered. CustomItem
is
focusable if its traverse method returns true.
In Form
navigation, the Arrow up and Arrow down
keys move the focus, scroll form, or do both. The key behavior (the Selection
key, the Arrow left and Arrow right keys) on a focused item varies from component
to component. Form navigation does not loop.
Form
s can contain the following Item
s:
Empty Form
s (Form
s with no Item
s)
are presented with the text no data
.
For more information about S60-specific Form
features,
see Form implementation
notes.