JLabel (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (value == null) { NULL_RENDERER.setOpaque(isSelected); NULL_RENDERER.setForeground(isSelected ? table.getSelectionForeground() : table.getForeground()); NULL_RENDERER.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); return NULL_RENDERER; } Renderer<Object> renderer = ObjectUtils.notNull(getRenderer(value.getClass()), DEFAULT_RENDERER); renderer.setOpaque(isSelected); renderer.setForeground(isSelected ? table.getSelectionForeground() : table.getForeground()); renderer.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); renderer.setValue(value); return renderer; }