// Lars Sorensen TYJava in 21 days // excode from pg 222 // // // import java.awt.Graphics; import java.awt.Event; import java.awt.Color; public class Spots extends java.applet.Applet { final int MAXSPOTS = 100; int xspots[] = new int[MAXSPOTS]; int yspots[] = new int[MAXSPOTS]; int currspots = 0; public void init() { setBackground(Color.white); } // end of init public boolean mouseDown(Event evt, int x, int y) { if (currspots < MAXSPOTS ) addspot(x,y); else System.out.println("Too many Spots Cheif!!"); return true; } public boolean keyDown(Event evt, int key) { if ( key == Event.HOME ) { setBackground(Color.white); currspots = 0; repaint(); } return true; } void addspot(int x, int y) { xspots[currspots] = x; yspots[currspots] = y; currspots++; repaint(); } public void paint(Graphics g) { g.setColor(Color.blue); for ( int i =0; i < currspots; i++ ) g.fillOval(xspots[i] -10, yspots[i] -10,20,20); } // end of paint } // end of class Spots...