JList list = new CheckBoxJList ();
DefaultListModel defModel = new DefaultListModel();
list.setModel (defModel);
String[] listItems = {
"Chris", "Joshua", "Daniel", "Michael",
"Don", "Kimi", "Kelly", "Keagan"
};
Iterator it = Arrays.asList(listItems).iterator();
while (it.hasNext())
defModel.addElement (it.next());
// show list
JScrollPane scroller =
new JScrollPane (list,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
JFrame frame = new JFrame ("Checkbox JList");
frame.getContentPane().add (scroller);
frame.pack();
frame.setVisible(true);