MainForm.java
上传用户:gyyuli
上传日期:2013-07-09
资源大小:3050k
文件大小:1k
源码类别:

J2ME

开发平台:

Java

  1. package exframework;
  2. import javax.microedition.lcdui.*;
  3. /**
  4.  * <p>Title: ExFramework</p>
  5.  *
  6.  * <p>Description: lizhenpeng</p>
  7.  *
  8.  * <p>Copyright: Copyright (c) 2005</p>
  9.  *
  10.  * <p>Company: LP&P</p>
  11.  *
  12.  * @author lipeng
  13.  * @version 1.0
  14.  */
  15. public class MainForm extends Form implements CommandListener
  16. {
  17.   public MainMIDlet midlet;
  18.   AllAction action;
  19.   public MainForm(MainMIDlet midlet)
  20.   {
  21.     super("演示结果");
  22.     this.midlet = midlet;
  23.     try
  24.     {
  25.       init();
  26.     }
  27.     catch(Exception e)
  28.     {
  29.       e.printStackTrace();
  30.     }
  31.    // action = new ExRMS();
  32. //    action = new ExPlayer();
  33.     //action = new ExThread("1");
  34.     //action = new ExVector();
  35.     //action = new ExRandom();
  36.     action = new ExTimer();
  37.    // action = new ExAlert();
  38.     //action = new ExPlayer();
  39.     action.allAction(this);
  40.    //this.append("alert over");
  41.   // this.addline("alert over");
  42.   }
  43.   private void init() throws Exception
  44.   {
  45.     setCommandListener(this);
  46.     addCommand(new Command("Exit", Command.EXIT, 1));
  47.   }
  48.   public void commandAction(Command command, Displayable displayable)
  49.   {
  50.     if (command.getCommandType() == Command.EXIT)
  51.     {
  52.       MainMIDlet.quitApp();
  53.     }
  54.   }
  55.   void addline(String str)
  56.   {
  57.     append(str);
  58.     append("n");
  59.   }
  60. }