main.java
上传用户:haojie1228
上传日期:2022-08-08
资源大小:347k
文件大小:2k
- package poker;
- import java.util.*;
- import javax.microedition.lcdui.*;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.midlet.MIDlet;
- public class main extends MIDlet {
- //public Display display;
- private static main instance;
- List imList;
- Command exitCmd,okCmd,downCmd,cancelCmd,helpCmd,closeCmd;
- boolean SystemError=false;
- Alert MsgBox=new Alert("ERROR");
- Form waitForm=new Form(" downloading...");
- String nowForm="";
- Timer one;
- //waitFor waitForTask;
- /** Constructor */
- public main() {
- try{
- instance = this;
- GetServicData.ServerImage=Image.createImage("/res/computer.gif");
- GetServicData.RoomImage = Image.createImage("/res/room.PNG");
- GetServicData.TableImage = Image.createImage("/res/table.png");
- }catch (Exception e){
- Error.errStr="Error when load image.";
- Error.errCode=2;
- return;
- }
- }
- /** Main method */
- public void startApp() {
- DataAccess da=DataAccess.getInstance();
- GameInfo.display=Display.getDisplay(this);
- GameInfo.midlet=this;
- Login loginForm;
- loginForm=new Login();
- GameInfo.display.setCurrent(loginForm);
- loginForm.drawFace();
- }
- /** Handle pausing the MIDlet */
- public void pauseApp() {
- }
- /** Handle destroying the MIDlet */
- public void destroyApp(boolean unconditional) {
- RoomList room = RoomList.getInstance();
- System.out.println("new room");
- try{
- room.one.cancel();
- }catch(Exception e){}
- System.out.println("room timer cancel");
- TableList table = TableList.getInstance();
- System.out.println("new table");
- try{
- table.one.cancel();
- }catch(Exception e){}
- System.out.println("table timer cancel");
- table.one=null;
- System.out.println("table.one = null");
- room=null;
- System.out.println("room = null");
- table=null;
- System.out.println("all timer has over");
- GameInfo.midlet.notifyDestroyed();
- }
- /** Quit the MIDlet */
- public static void quitApp() {
- }
- }//end program