list.setCellRenderer(new CheckListRenderer());
list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
list.setBorder(new EmptyBorder(0, 4, 0, 0));
list.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
int index = list.locationToIndex(e.getPoint());
CheckableItem item = (CheckableItem) list.getModel()
.getElementAt(index);
item.setSelected(!item.isSelected());
Rectangle rect = list.getCellBounds(index, index);
list.repaint(rect);