/************************************** * Source & Further Reading: J. W. Muchow (2002), Core J2ME Technology & MIDP, Sun MICROSYSTEMS ***************************************/ /* the main MIDlet for Animation */ import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class AnimTimer extends MIDlet{ private Display display; // reference to a display object protected TimerCanvas cvTimer; // canvas to display timer protected OptionsList lsOpt; // list to change options protected SleepForm fmSleep; //Form with agauge to set timer sleep protected DisplayManager displayMgr; // class to manage screens // constructor public AnimTimer(){ display = Display.getDisplay(this); cvTimer = new TimerCanvas(this); lsOpt = new OptionsList("Timer options", List.IMPLICIT, this); fmSleep = new SleepForm("Adjust sleep", this); // create a display manger object displayMgr = new DisplayManager(display, cvTimer); } protected void startApp(){ // start with the Canvas display.setCurrent(cvTimer); } protected void pauseApp(){ } protected void destroyApp(boolean unconditional){ } public void exitMIDlet(){ destroyApp(true); notifyDestroyed(); } }