Item (tag)

From JAXXWiki

The <item> tag is used to specify values for the <JComboBox>, <JList>, and <JTree> tags.

Contents

Attributes

AttributeTypeDescription
labeljava.lang.StringThe string used to represent the value (when the default renderer is in use). If label is not specified, value.toString() is used instead.
valuejava.lang.ObjectThe item's value, which appears in the component's model. Use data binding expressions to specify values of types other than String.
selectedbooleanThe initial selection state of the item. Defaults to false.

Child tags

When used in a <JTree>, <item> tags form a nested heirarchy which reflects the actual tree structure. Therefore in <JTree>s, <item> tags may contain other <item> tags.

Data binding

As with class tags, all of the <item> tag's attributes may be assigned data binding expressions, and updates will be properly reflected in the on-screen item's appearance.

See also