main.java
来自「网上斗地主的JAVA源码,可以学习一下. J2EE项目开发实例源代码」· Java 代码 · 共 80 行
JAVA
80 行
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
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?