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

📄 gamemidlet.java

📁 一个发送短信和接受短信的代码!忽忽忽忽户忽忽忽忽!
💻 JAVA
字号:
package fourconnect;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Displayable;

public class gamemidlet extends MIDlet implements CommandListener {
	// private Form form;
	private gamecanvas canvas;

	private Display display;

	private Form form;

	private Command exit;

	private Command ok;

	private ChoiceGroup choice;

	private String type[] = { "server", "client" };

	private String strtype;

	public gamemidlet() {
		form = new Form("四子棋");
		display = Display.getDisplay(this);

		choice = new ChoiceGroup("please slect a type", Choice.EXCLUSIVE, type,
				null);
		exit = new Command("exit", Command.EXIT, 1);
		ok = new Command("ok", Command.CANCEL, 1);
		form.addCommand(exit);
		form.addCommand(ok);
		form.append(choice);
		form.setCommandListener(this);
	}

	protected void startApp() {
		// canvas.start();
		display.setCurrent(form);
	}

	protected void pauseApp() {

	}

	protected void destroyApp(boolean boolean0) {
	}

	public void commandAction(Command command, Displayable displayable) {
		if (command == exit) {
			destroyApp(false);
			notifyDestroyed();
		} else if (command == ok) {
			strtype = choice.getString(choice.getSelectedIndex());
			// System.out.println(strtype);
			canvas = new gamecanvas(display, strtype);
			// canvas.start();
		}
	}
}

⌨️ 快捷键说明

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