import java.awt.*; public class Election extends java.applet.Applet { final int NUMCOUNTIES = 67; boolean CountiesFinished[] = new boolean[67]; int Finished; County county[] = new County[NUMCOUNTIES]; Time timeflow; int time; // integer representation of time // each 1 represents an hour since the // beginning of the election Image florida; // GIF file map of florida. Image offscreen; // used for double buffering Graphics offscreenG; BorderLayout b = new BorderLayout(); TextArea text = new TextArea(3, 10); public void paint(Graphics g) { Integer num, numdone, numtot; int i, tot=0; // draw florida boolean b = g.drawImage(florida, 30, 30, this); Finished = 0; // fill in county colors for (i=0;i county[i].gorecount) g.setColor(Color.red); else g.setColor(Color.blue); g.fillRect(27+county[i].x,27+county[i].y,8,8); tot += county[i].bushcount - county[i].gorecount; if (CountiesFinished[i]) Finished++; } // update edit window numdone = new Integer(Finished); numtot = new Integer(NUMCOUNTIES); if (tot < 0) { num = new Integer(-tot); text.append(" LEADER--Gore: +" + num.toString() + '\n'); } else { num = new Integer(tot); text.append(" LEADER--Bush: +" + num.toString() + '\n'); } text.append(numdone.toString() + " of " + numtot.toString() + " counties reporting.\n"); } public void update(Graphics g) { paint(offscreenG); // draw buffer onto applet g.drawImage(offscreen,0,0,this); } public void init() { int i; // declare an array of threads for (i=0;i