private final int CHECK_BOX_SIZE = 12;
public void paintIcon(Component c, Graphics g, int x, int y) {
AbstractButton button = (AbstractButton) c;
Graphics2D graphics = (Graphics2D) g.create();
// translate the graphics context so that 0,0 is the top/left of the check box. this
// allows us to then delegate the painting to the HudPaintingUtils method, which assumes
// 0,0.
graphics.translate(x, y);
HudPaintingUtils.paintHudControlBackground(graphics, button, CHECK_BOX_SIZE,
CHECK_BOX_SIZE, HudPaintingUtils.Roundedness.CHECK_BOX);
drawCheckMarkIfNecessary(graphics, button.getModel());
graphics.dispose();
}