Here you can find the source of getDisabledImage(Image image)
Parameter | Description |
---|---|
image | The image to disable |
public static final Image getDisabledImage(Image image)
//package com.java2s; // License: GPL. For details, see LICENSE file. import java.awt.Image; import java.awt.Toolkit; import java.awt.image.FilteredImageSource; import javax.swing.GrayFilter; public class Main { /**//from w w w.j a v a 2s . com * Replies the disabled (grayed) version of the specified image. * @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))); } }