adding a lot of elements to a list
I would like to add a large number of strings to a list, but I'm at a loss as to how to do it. I basically have an array of strings that I would like to put in the list
listModel =new DefaultListModel();
String[] clients ={lots of strings here}
listModel.addElement(clients);
list =new JList(listModel);
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
list.setSelectedIndex(0);
list.addListSelectionListener(this);
list.setVisibleRowCount(10);
JScrollPane listScrollPane =new JScrollPane(list);
This code doesn't work because it won't let me add the string array
thanks

