⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainmenu.java

📁 青蛙過河~ 就是青蛙過馬路 過馬路很危險請小心... that s a
💻 JAVA
字号:
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Displayable; 


public class MainMenu extends Form implements CommandListener{
	
	
   	private RoadRun theMidlet;
   	private Command start;
   	private Command exit;

   	protected MainMenu(RoadRun midlet){

      	super("");

      	theMidlet = midlet;
      	
		// add the welcome text
	    append("\nWelcome to\n");
	    append("R-O-A-D R-U-N");
	    
		// create and add the commands
	    int priority = 1; 
	    start = new Command("Start", Command.SCREEN, priority++);
	    exit = new Command("Exit", Command.EXIT, priority++);
	
	    addCommand(start);
	    addCommand(exit);
	
	    setCommandListener(this);
	}

   	public void commandAction(Command command, Displayable displayable){
      	if (command == start)
         	theMidlet.activateGameScreen();   //笴栏币笆
      	if (command == exit)
         	theMidlet.close();
   	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -