* Can't use {@link SimpleTableCellRenderer} because it displays {@link Presentation#toString()} * along with the icon. The string ("true" or "false") is defined only for testing; * it's not intended for display. SimpleTableCellRenderer also has features not used * for icon display. */ private static class Renderer extends DefaultTableCellRenderer { /** * Create a renderer that displays an icon in the top center of the cell. */ public Renderer() { setHorizontalAlignment (CENTER); setVerticalAlignment (TOP); setHorizontalAlignment(CENTER); // Don't display text, just display icon. setText (null); } @Override protected void setValue (Object value) { if (value instanceof Presentation) { setIcon (((Presentation)value).smallIcon); } else { setIcon (null); } } private static final long serialVersionUID = 1L; } private final Icon trueIcon; private final Icon falseIcon; private final Presentation truePresentation; private final Presentation falsePresentation; private final Renderer renderer; }