exitCommand=new Command("退出",Command.EXIT,1); okCommand=new Command("确定",Command.OK,1); backCommand=new Command("后退",Command.BACK,2); choiceForm.append(faceChoice); choiceForm.append(styleChoice); choiceForm.append(sizeChoice); choiceForm.addCommand(exitCommand); choiceForm.addCommand(okCommand); choiceForm.setCommandListener(this); canvas=new MyCanvas(); } public void startApp() { aDisplay=Display.getDisplay(this); aDisplay.setCurrent(choiceForm); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } public void commandAction(Command c ,Displayable d){ if (c==exitCommand){ destroyApp(false); notifyDestroyed(); } else { //select the face and size face=faceChoice.getSelectedIndex(); switch(face){ case 0: face=Font.FACE_PROPORTIONAL;break; case 1: face=Font.FACE_MONOSPACE;break; case 2: face=Font.FACE_SYSTEM;break; |