import java.awt.Graphics; import java.awt.Color; import java.awt.Event; import java.applet.AudioClip; public class events1 extends java.applet.Applet { public void paint(Graphics g) { for (int i=0 ; i <= 4 ; i++) { g.setColor(new Color(63*i,100,(255-(63*i)))); g.fillRect((i-1)*100,0,i*100,80); } } public boolean mouseDown(Event evt, int x, int y) { if (x < 100) play(getCodeBase(),"bark.au"); if ((x > 100)&(x < 200)) play(getCodeBase(),"honk.au"); if ((x > 200)&(x < 300)) play(getCodeBase(),"cellular.au"); if (x > 300) play(getCodeBase(),"feryhorn.au"); return true; } }