Code example for FilteredImageSource

0
     * @param image The image to disable 
     * @return The disabled (grayed) version of the specified image, brightened by 20%. 
     * @since 5484 
     */ 
    public static final Image getDisabledImage(Image image) {
        return Toolkit.getDefaultToolkit().createImage(
                new FilteredImageSource(image.getSource(), new GrayFilter(true, 20)));
    } 
 
    /** 
     * Replies the disabled (grayed) version of the specified icon. 
     * @param icon The icon to disable 
     * @return The disabled (grayed) version of the specified icon, brightened by 20%. 
     * @since 5484 
     */ 
    public static final ImageIcon getDisabledIcon(ImageIcon icon) {
        return new ImageIcon(getDisabledImage(icon.getImage()));
    } 
 
    /**