Java tutorial
//package com.java2s; import java.awt.Component; import javax.swing.DefaultListCellRenderer; import javax.swing.JList; import javax.swing.ListCellRenderer; public class Main { /** * Used to get a cell renderer for JLists that shows no visible selection * * @return */ public static ListCellRenderer<?> createInvisibleCellRenderer() { return new DefaultListCellRenderer() { public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, false, false); return this; } }; } }