private static JList<String> createFileList(List<String> fileNames){
  JList<String> fileList=new JList<String>(fileNames.toArray(new String[0]));
  fileList.setVisibleRowCount(5);
  fileList.setCellRenderer(new FileNameListCellRenderer());
  fileList.setFocusable(false);
  return fileList;
}

private static JList < String > createFileList ( List < String > fileNames ) { JList < String > fileList = new JList < String > ( fileNames . toArray ( new String [ 0 ] ) ) ; fileList . setVisibleRowCount ( 5 ) ; fileList . setCellRenderer ( new FileNameListCellRenderer ( ) ) ; fileList . setFocusable ( false ) ; return fileList ; }
creates a jlist of files and sets and makes it non - selectable .
