private void createIcons() {
Border border = style.getBorderDown();
Insets insets = border.getBorderInsets(null);
// Image used as the template for the icons
final GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
BufferedImage image = gc.createCompatibleImage(ICON_WIDTH, ICON_WIDTH, Transparency.OPAQUE);
// Active, not selected
Graphics2D g = image.createGraphics();
g.setColor(style.getForeground());
g.fillRect(0, 0, ICON_WIDTH, ICON_WIDTH);
g.setClip(0, 0, ICON_WIDTH, ICON_WIDTH);
border.paintBorder(null, g, 0, 0, ICON_WIDTH, ICON_WIDTH);
g.dispose();
defaultIcon = new ImageIcon(image);
// Active, selected
// Icon does not copy the image, so we need a new one
BufferedImage image2 = gc.createCompatibleImage(ICON_WIDTH, ICON_WIDTH, Transparency.OPAQUE);
g = image2.createGraphics();
// Copy the old image to the background
g.drawImage(image, 0, 0, null);
// Draw the tick
BasicStroke stroke = new BasicStroke(2);
g.setStroke(stroke);
g.setColor(style.getShadowColor());
drawTick(g, insets);
g.dispose();
defaultSelectedIcon = new ImageIcon(image2);
// Inactive, not selected
image2 = gc.createCompatibleImage(ICON_WIDTH, ICON_WIDTH, Transparency.OPAQUE);
g = image2.createGraphics();
g.setColor(style.getShadowColor());
g.fillRect(0, 0, ICON_WIDTH, ICON_WIDTH);
g.setClip(0, 0, ICON_WIDTH, ICON_WIDTH);
border.paintBorder(null, g, 0, 0, ICON_WIDTH, ICON_WIDTH);
g.dispose();
disabledIcon = new ImageIcon(image2);
// Inactive, selected
image = gc.createCompatibleImage(ICON_WIDTH, ICON_WIDTH, Transparency.OPAQUE);
g = image.createGraphics();
// Copy unselected image
g.drawImage(image2, 0, 0, null);
g.setStroke(stroke);
g.setColor(style.getHighLightColor());