Code example for Icon

Methods: getIconHeightgetIconWidthpaintIcon

0
 
    private BufferedImage createMask(Icon mask) {
        // create a BufferedImage to paint the mask into so that we can later retrieve pixel data 
        // out of the image. 
        BufferedImage image = new BufferedImage(
                mask.getIconWidth(), mask.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
 
        Graphics graphics = image.getGraphics();
        mask.paintIcon(null, graphics, 0, 0);
        graphics.dispose();
 
        return image;
    } 
 
    public Icon getIcon() {
        return WindowUtils.isParentWindowFocused(this) || fInactiveIcon == null
                ? super.getIcon() : fInactiveIcon;
    } 
 
    @Override