|
|
|
|
|
|
SolutionDownload CheckboxTest source code.HTML Interface to Applet<APPLET CODEBASE="/applets/magelang/AWT-Training/classes/" CODE="CheckboxTest.class" WIDTH=300 HEIGHT=30 ALIGN=CENTER></APPLET> Java Codeimport java.awt.*; public class CheckboxTest extends java.applet.Applet { public CheckboxTest() { MyCheckbox m = new MyCheckbox(); add(m); } } class MyCheckbox extends Checkbox { public MyCheckbox() { super("Always Prompt"); } public boolean action(Event e, Object state) { System.out.println("State is " + (Boolean) state); return true; } } |