GrayFilter.createDisabledImage(Image i) has the following syntax.
public static Image createDisabledImage(Image i)
In the following code shows how to use GrayFilter.createDisabledImage(Image i) method.
import java.awt.Image; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; //from w w w . ja v a 2 s. c o m import javax.swing.GrayFilter; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class Main extends JFrame { public Main() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel p = new JPanel(); ImageIcon icon = new ImageIcon("r.gif"); JButton b1 = new JButton("Regular", icon); p.add(b1); Image image = GrayFilter.createDisabledImage(icon.getImage()); JButton b2 = new JButton("GrayFilter", new ImageIcon(image)); p.add(b2); getContentPane().add(p); pack(); setVisible(true); } public static void main(String arg[]) { new Main(); } }