GrayButtonpublic class GrayButton extends Applet
Fields Summary |
---|
Image | i | Image | gray |
Methods Summary |
---|
public void | init()
i = this.getImage(this.getDocumentBase(), "images/button.gif");
ImageFilter f = new GrayFilter();
ImageProducer producer = new FilteredImageSource(i.getSource(), f);
gray = this.createImage(producer);
| public boolean | mouseDown(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 boolean | mouseUp(java.awt.Event e, int x, int y)
update(this.getGraphics());
return true;
| public void | paint(java.awt.Graphics g)
g.drawImage(i, 20, 20, this);
|
|