Object value,
int index,
boolean isSelected,
boolean cellHasFocus) {
JPrettyLabel label = (JPrettyLabel)super.getListCellRendererComponent(
list, value, index, isSelected, cellHasFocus);
//pad five pixels on left and right:
label.setBorder(BorderFactory.createEmptyBorder(0,5,0,5));
label.setOpaque(false);
if (value instanceof GroupElement) {
label.setBorder(BorderFactory.createLineBorder(Color.GRAY));
label.setBackgroundPainter(groupPainter);
label.setFont(label.getFont().deriveFont(Font.BOLD));
}
if (isSelected) {
label.setBackgroundPainter(selectedPainter);
label.setForeground(Color.WHITE);
label.setFont(label.getFont().deriveFont(Font.ITALIC));
}
return label;
}