Google has been very unhelpful, and believe me this is a last very sad resort. Or don’t I don’t care.
I create a JList, and when i call setListData(String[]) it merges all the items in my String[] into one and sticks it in one slot of the List.
Here is how I create it. rooms = {“Loading List”}
DefaultListModel listModel = new DefaultListModel();
list = new JList(listModel);
list.setListData(rooms);
Here is where I try and use setListData
public void setRooms(String[] rooms) {
int index = list.getSelectedIndex();
list.setListData(rooms);
list.setSelectedIndex(index);
}
In the specific case I have been trying rooms is {“Frog”, “Toad”}
The JList’s first item changes from “Loading List” to “FrogToad”
I also tried converting the String[] to a Vector and adding it that way, same result.