import java.awt.*; import java.applet.Applet; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; public class TrivialApplet extends Applet { private final int WAIT = 0; private final int HTML_HEIGHT = 700; //replace with Dimension private final int HTML_WIDTH = 1000; // " " " private LifeGame game; public TrivialApplet() { game = new LifeGame(HTML_HEIGHT, HTML_WIDTH); class RestartListener extends MouseAdapter { public void mouseClicked(MouseEvent event) { //restart on click game = new LifeGame(HTML_HEIGHT, HTML_WIDTH); } } addMouseListener(new RestartListener()); } public void init() { repaint(); } public void paint(Graphics g) { Graphics2D g2 = (Graphics2D)g; game.draw(g2); for(int i = 0; i < WAIT; i++) { i = i; } game.nextGen(); repaint(); } }