Overview | Methods | Fields | This Package | All Packages

OverviewMethodsFieldsThis PackageAll Packages


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


public final int addItem( Object 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.


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