Lists

A list is a rectangular container that holds a list of items, which can be selected by clicking on the item.
List Money = new List();
Money.add(“Penny”);
Money.add(“Nickel”);


Often a list will have two listeners, one listener for when an item is clicked once and another for when an item is double clicked. One click sends and item event while double clicking on and item is an action event.


A list can have a scroll bar when there is a long list of items. Sometimes a scroll bar can be avoided by distinguishing how many items you want shown at a time.
List people = new List(6);
//this shows 6 items in the list window at a time