Component (JList<? extends XmlElementDescriptor> list, XmlElementDescriptor value, int index, boolean isSelected, boolean cellHasFocus) { Color backgroundColor = isSelected ? list.getSelectionBackground() : list.getBackground(); myNameLabel.setText(value.getName()); myNameLabel.setForeground(isSelected ? list.getSelectionForeground() : list.getForeground()); myPanel.setBackground(backgroundColor); myNSLabel.setText(getNamespace(value)); myNSLabel.setForeground(LookupCellRenderer.getGrayedForeground(isSelected)); myNSLabel.setBackground(backgroundColor); return myPanel; }