FileDocCategorySizeDatePackage
GrayButton.javaAPI DocExample1917Fri Apr 05 12:20:24 BST 1996None

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);