public Icon getIcon(File obj) { String extension = FilenameUtils.getExtension(obj.getName()); if (extension != null) { return IconManager.instance().getIconForExtension(extension); } return null; }
@Override public Component getListCellRendererComponent( JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); String extension = FilenameUtils.getExtension(value.toString()); if (extension != null) { setIcon(IconManager.instance().getIconForExtension(extension)); } return this; }