ListBox.setSelectedItem

Overview | Methods | Fields | This Package | All Packages

ListBox.setSelectedItem

Selects the first occurrence of the specified item in a single-selection list box, and returns the zero-based index of the item.

Syntax

public final int setSelectedItem( Object value )

Parameters

value

The object (generally a String object) to select.

Return Value

Returns the zero-based index of the selected item if it exists in the list box; returns -1 if the item is not in the list box.

See Also   getSelectedItem