dialog.setMaxSelections(-1); //Allow arbitrary number of selections.
dialog.setMinSelections(0);//We don't need to select any.
dialog.setVisible(true);
dialog.addOkListener(new ActionListener()
{
public void actionPerformed(ActionEvent ev)
{
String[] names = dialog.getSelectedNames();