A
List
is a scrollable array of text items. The list may be setup in the constructor to allow either a single item to be selected at any one time or to allow multiple items to be selected.When an item is selected or deselected with a single click, an
event
is sent to the list or to its container, depending on the particular Java release. When an item is selected or deselected with a double click or when the user his areturn
, an action event is sent. Thus, lists are manipulated by eitherhandleEvent
oraction
method overrides.See the
List
class in the java.awt package.Example:
Panel langPanel = new Panel ( ); Label langLabel = new Label ( "Favorite Language:"); List favoriteLang = new List ( 5, false );