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

[845 byte] By [snoboardera] at [2007-11-27 7:44:16]
# 1
Read the API: http://java.sun.com/javase/6/docs/api/javax/swing/DefaultListModel.html#addElement(java.lang.Object)addElement add one element to the model. Call it in a loop to pass all the array elements.
Hippolytea at 2007-7-12 19:24:55 > top of Java-index,Desktop,Core GUI APIs...
# 2
> I basically have an array of strings that I would like to put in the listHave you actually read the JList API? There are only 3 constructors. Its not that hard to figure out which one will work for you.
camickra at 2007-7-12 19:24:55 > top of Java-index,Desktop,Core GUI APIs...
# 3
here a hint.set"blank"Data
blackmagea at 2007-7-12 19:24:55 > top of Java-index,Desktop,Core GUI APIs...