import java.awt.*; import java.applet.*; import java.awt.Toolkit; /**-------------------------------------------------------- // This file is called TemplateApplet.java 1) One public class per Java file and IT MUST be the name of the file. 2) Must import java.awt and java.applet 3) init/start are suggested 4) TemplateApplet is just a name, it can be anything Please use AppletGen(if you can) to generate more advanced applet skeletons to save typing. --------------------------------------------------------*/ public class Test extends Applet { int bob=0; TextField txt; public void init() { Image image; showStatus("init() was called"); txt = new TextField("default",20); add(txt); txt.setText("testing"); image = Toolkit.getImage("duke.gif"); } public void start() { bob=1; showStatus("start() was called"); } void minit(){ bob=1;} public void main(String args[]) { Frame f = new Frame("Test"); Test test = new Test(); minit(); test.init(); f.add("Center", test); f.resize(400, 200); f.show(); } public void stop() { showStatus("stop() was called"); } public void destroy() { showStatus("destroy() was called"); } }