FileDocCategorySizeDatePackage
GrayButton.javaAPI DocExample1971Sat Jun 02 03:12:32 BST 2001None

GrayButton

public class GrayButton extends Applet

Fields Summary
Image
i
Image
gray
Constructors Summary
Methods Summary
public voidinit()

        i = this.getImage(this.getDocumentBase(), "images/button.gif");
        ImageFilter f = new GrayFilter();
        ImageProducer producer = new FilteredImageSource(i.getSource(), f);
        gray = this.createImage(producer);
    
public booleanmouseDown(java.awt.Event e, int x, int y)

        Graphics g = this.getGraphics();
        Dimension d = this.size();
        g.clearRect(0, 0, d.width, d.height);
        g.drawImage(gray, 20, 20, this);
        return true;
    
public booleanmouseUp(java.awt.Event e, int x, int y)

        update(this.getGraphics());
        return true;
    
public voidpaint(java.awt.Graphics g)

        g.drawImage(i, 20, 20, this);