Generally, a user selects an item by clicking it, and indicates that an action should occur by double-clicking an item or pressing Return.
Lists can allow either multiple selections or just one selection at a time.
Other components that allow users to choose from multiple options are checkboxes , choices , and menus . Below is an applet that shows two lists, along with a text area that displays information about events. Note that the first item in each list has index 0. Below is the code that creates each list and handles events on the lists. Returns the number of items in the List.