ListBox.addItem

Overview | Methods | Fields | This Package | All Packages

ListBox.addItem

Adds an item to the list box, and returns the index of the new item.

Syntax

public final int addItem( Object item )

Parameters

item

An object (generally a String object) whose toString method returns the string you want to display in the  list box.

Return Value

Returns index of where the item was inserted.

Remarks

If the sorted property of the list box is set to true, the item is inserted into the list alphabetically. Otherwise, the item is inserted at the end of the list. To insert an item into the list box at a specific position, use the insertItem method. To add a set of items to the list box at one time, use the setItems method.

See Also   removeItem