protected JScrollPane createDirectoryList() { directoryList = new JList(); align(directoryList); directoryList.setCellRenderer(new DirectoryCellRenderer()); directoryList.setModel(new MotifDirectoryListModel()); directoryList.addMouseListener(createDoubleClickListener(getFileChooser(), directoryList)); directoryList.addListSelectionListener(createListSelectionListener(getFileChooser())); JScrollPane scrollpane = new JScrollPane(directoryList); scrollpane.setMaximumSize(MAX_SIZE); scrollpane.setPreferredSize(prefListSize); align(scrollpane); return scrollpane; }
protected JScrollPane createFilesList() { fileList = new JList(); if (getFileChooser().isMultiSelectionEnabled()) { fileList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); } else { fileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); } fileList.setModel(new MotifFileListModel()); fileList.setCellRenderer(new FileCellRenderer()); fileList.addListSelectionListener(createListSelectionListener(getFileChooser())); fileList.addMouseListener(createDoubleClickListener(getFileChooser(), fileList)); align(fileList); JScrollPane scrollpane = new JScrollPane(fileList); scrollpane.setPreferredSize(prefListSize); scrollpane.setMaximumSize(MAX_SIZE); align(scrollpane); return scrollpane; }