![]() |
![]() |
![]() |
![]() |
![]() |
|
JList.
Use the setListData method, with a vector-of-strings argument, to
establish the contents of the choice list.
valueChanged
method, then obtain the selected element's index inside
valueChanged using getSelectedIndex, and then use
addListSelectionListener to attach a listener instance to the
choice list.
JScrollPane class by
instantiating the following pattern:
new JScrollPane(choice list)
and then add the scroll pane, rather than the choice list itself, to the surrounding applet or frame.