public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {

            if (table == null) {
                // ???
            } else {
                if (isSelected) {
                    setForeground(table.getSelectionForeground());
                    setBackground(table.getSelectionBackground());
                    if (!table.isCellEditable(row, column)) {
                        this.setBackground(Color.BLACK);
                    }
                } else {
                    setForeground(table.getForeground());
                    setBackground(table.getBackground());
                    if (!table.isCellEditable(row, column)) {
                        this.setBackground(Color.BLACK);
                    }

                }
                setEnabled(table.isEnabled());
                setComponentOrientation(table.getComponentOrientation());

                if (hasFocus) {
                    if (focusBorder == null) {
                        focusBorder = UIManager.getBorder("Table.focusCellHighlightBorder");
                    }
                    setBorder(focusBorder);
                } else {
                    if (noFocusBorder == null) {
                        if (focusBorder == null) {
                            focusBorder = UIManager.getBorder("Table.focusCellHighlightBorder");
                        }
                        if (focusBorder != null) {
                            Insets n = focusBorder.getBorderInsets(this);
                            noFocusBorder = new EmptyBorder(n);
                        }
                    }
                    setBorder(noFocusBorder);
                }

                setSelected(Boolean.TRUE.equals(value));
            }
            return this;
        }