SpringGUI

introduction    download    reference    examples    faq


Reference

Name

getItemByIndex()

Examples

// removes all items from a List.
int num = gui.getItemCount("myList");
for (int i=0; i<num; i++) {
  // get the first item in the List
  String item = gui.getItemByIndex("myList",0);
  gui.removeItem("myList", item); // remove it.
}

Description

Returns an item in a List or Choice element by its index.

Syntax

String item = gui.getItemByIndex(name, index);

Parameters

String name The name of the List or Choice element.
int index The index of the item.

Returns

The name of the item if the element can be found and is either a Choice or a List element, and the index is within the number of items in the element. null otherwise.

Related

addItem()
removeItem()
hasItem()
getItemCount()
isListMultipleMode(), setListMultipleMode()
getSelectedItem() / getSelectedItems()
selectItem()
addChoice()
addList()
table of events


back to the top of the page


tinkering with codetools and docsscrapbookabout