package gametemplate; import javax.swing.JApplet; public class GameApplet extends JApplet { private GamePanel gp; private Game game; public void init() { game=new TryGame(); gp=new GamePanel(game); game.setup(this, gp); add(gp); //important to request focus so that keyboard input will be handled by GamePanel. gp.requestFocus(); gp.start(); } //Those three methods are not called by my program, but can be called by the browser //where the applet resides. public void start() { gp.setPause(false); } public void stop() { gp.setPause(true); } public void destroy() { gp.stop(); } }