@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (value == null) return this; if (value instanceof LastRowAggregatedValue) { return nonEditableCellRender.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); } this.setSelected((boolean) value); if (isSelected) this.setBackground(table.getSelectionBackground()); else this.setBackground(table.isCellEditable(row, column) ? (Color) UIManager.get("CheckBox.interiorBackground") : bgColorNonEditable); this.setBorder(hasFocus ? UIManager.getBorder("Table.focusCellHighlightBorder") : noFocusBorder); return this; } }