public java.awt.Component | getListCellRendererComponent(javax.swing.JList list, java.lang.Object value, int index, boolean isSelected, boolean cellHasFocus)
BookEntry entry = (BookEntry)value;
setText(entry.getTitle());
setIcon(entry.getImage());
if(isSelected) {
setBackground(HIGHLIGHT_COLOR);
setForeground(Color.white);
} else {
setBackground(Color.white);
setForeground(Color.black);
}
return this;
|