List Methods

You create a new List with one of these three
constructors:

public List()
public List(int numLines)
public List(int numLines, boolean allowMultipleSelections)

For example,

List l = new List(8, true);

numLines is the number of items you want to be
visible in the scrolling list. It is not necessarily the same as
the number of items in the list which is limited only by available
memory. allowMultipleSelections says whether the user
is allowed to select more than one item at once (typically by
Shift-clicking).

public int getItemCount()
public String getItem(int index)
public String[] getItems()

You ran also replace a particular item:

public void replaceItem(String newValue, int index)

These methods allow you to determine which item the user has
selected:

public int getSelectedIndex()
public int[] getSelectedIndexes()
public String getSelectedItem()
public String[] getSelectedItems()
public Object[] getSelectedObjects()

If a list allows multiple selections, you should use the plural
forms of the above methods. You can determine whether multiple
selections are allowed with isMultipleMode() and
change it with setMultipleMode().