I created a JList that contains a list of files that are in a directory. Here is the JList.
JList
JList MList; String ListData[] // Creat
Create list of strings List fnames = new ArrayList();, fill it with file names (fnames.add(files);), then set it to JList using list.setListData(fnames.toArray());. I guess that should work.
List fnames = new ArrayList();
fnames.add(files);
list.setListData(fnames.toArray());