// This project is designed to create Arcs import javax.microedition.lcdui.*; import javax.microedition.midlet.*; public class MyArcs extends MIDlet { private Display display; // display private ArcsCanvas canvas; // canvas // constructor public MyArcs(){ display = Display.getDisplay(this); canvas = new ArcsCanvas(this); } // startApp protected void startApp(){ display.setCurrent(canvas); } // pauseApp protected void pauseApp(){ } // destroyApp protected void destroyApp(boolean unconditional){ } public void exitMIDlet() { destroyApp(true); notifyDestroyed(); } } // Class ArcsCanvas - Draw Arcs class ArcsCanvas extends Canvas implements CommandListener { private Command cmExit; // Exit Command private MyArcs midlet; public ArcsCanvas(MyArcs midlet){ this.midlet = midlet; // create command and listen for events cmExit = new Command("Exit", Command.EXIT, 1); addCommand(cmExit); setCommandListener(this); } // Draw an Arc protected void paint(Graphics g){ // Start at 12 o'clock and rotate 240 degrees width and height to be 70 g.drawArc(35, 355, 70, 70, 90, 240); //start at 3 o'clock and rotate 225 degrees g.drawArc(35, 35, 75, 75, 0, 225); // change the size of the bounding box start at 12 and rotate 280 g.drawArc(25, 35, 30, 50, 90, 280); } public void commandAction(Command c, Displayable d){ if(c == cmExit) midlet.exitMIDlet(); } }