📄 main.java
字号:
/*
* @(#)MainForm.java 1.11 01/08/23
* Copyright (c) 2004-2005 wuhua of workroom Inc. All Rights Reserved.
* @version 1.0, 10/05/2004
* @author 饶荣庆
* @author
*/
package com.wuhua.mali;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;
/**
*类MainForm是作为应用程序的主类。
*并初始化了应用程序的启动一些元素
*/
public class Main extends MIDlet implements CommandListener
{
public Display display = null;
public GameMenu gameMenu = null;
public Command okCommand = null; //定义确定软键
public Command exitCommand = null; //定义离开软键
/** 初始化应用程序*/
public Main()
{
this.okCommand = new Command("确定", Command.OK, 2);
this.exitCommand = new Command("离开", Command.EXIT, 2);
this.gameMenu = new GameMenu("游戏");
this.gameMenu.addCommand(exitCommand);
this.gameMenu.setCommandListener(this);
}
public void startApp()
{
this.display = Display.getDisplay(this);
this.display.setCurrent(gameMenu);
}
public void pauseApp()
{}
public void destroyApp(boolean unconditional)
{}
/*退出方法*/
public void exit()
{
this.destroyApp(false);
this.notifyDestroyed();
}
public void commandAction(Command c,Displayable s)
{
System.out.println("dsfsd");
if(c==exitCommand)
{
this.exit();
}else{
WelcomeToGame welcomeToGame = new WelcomeToGame();
welcomeToGame.showForm(display, gameMenu);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -