import java.awt.*; import java.applet.Applet; // This program copyright Michael Ringel, 1999. public class Woburn extends Applet { //open 1 Woburn private boolean laidOut = false; private boolean havegone = false; TextField tf; Button b; int density, iter, x, y; public void init() {//open 2 init setLayout(null); tf = new TextField(10); tf.enable(); tf.setText("2000"); b = new Button("Run"); add(b); add(tf); validate(); }//close 2 init public boolean action (Event e, Object arg) {//open 2 action if (e.target==b) {//open 3 button density = Integer.parseInt(tf.getText()); if (density>100000) { density=(int)100000; tf.setText("100000"); } if (density<0) { density=(int)0; tf.setText("0"); } havegone=true; repaint(); return true; }//close 3 button return false; }//close 2 action public void paint (Graphics g) {//open 2 paint if (!laidOut) {//open 3 layout tf.reshape(10,10,60,30); b.reshape(75,10,60,30); laidOut = true; }//close 3 layout g.setColor(getBackground()); g.draw3DRect(11,46,400,400,false); g.draw3DRect(10,45,402,402,true); //g.setColor(getForeground()); if (havegone==true) {//open 3 if loop for (iter=0;iter-->