BufferedImage (Component c, Graphics2D g) { BufferedImage image = c != null ? ImageUtil.createImage(c.getGraphicsConfiguration(), getIconWidth(), getIconHeight(), BufferedImage.TYPE_INT_ARGB) : ImageUtil.createImage(g, getIconWidth(), getIconHeight(), BufferedImage.TYPE_INT_ARGB); paintIcon(image.createGraphics()); return image; }