@Override
    public Component getTableCellRendererComponent(JTable table, Object value,
                                                   boolean isSelected, boolean hasFocus,
                                                   int row, int column) {
        // Check that the row is not selected.
        JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        if (!isSelected) {
            label.setBackground(row % 2 == 0 ? Color.LIGHT_GRAY : Color.WHITE);
        }
        return label;
    }