TableCellRenderer (UserDefinedJsonSchemaConfiguration.Item item) { return new DefaultTableCellRenderer() { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel label = (JLabel)super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); label.setIcon(item.mappingKind.getIcon()); String error = item.getError(); if (error == null) { return label; } JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(label, BorderLayout.CENTER); JLabel warning = new JLabel(AllIcons.General.Warning); panel.setBackground(label.getBackground()); panel.setToolTipText(error); panel.add(warning, BorderLayout.LINE_END); return panel; } }; }