📄 netform.java
字号:
import javax.microedition.midlet.*;import javax.microedition.lcdui.*; public class NetForm extends Form implements CommandListener { private GameMidlet gameMidlet; private ChoiceGroup group; private Command cmd_OK; private Command cmd_BACK; public NetForm(GameMidlet gameMidlet) { super("Online"); this.gameMidlet = gameMidlet; group = new ChoiceGroup("Choose",Choice.EXCLUSIVE); cmd_OK = new Command("OK",Command.OK,1); cmd_BACK = new Command("Back",Command.BACK,1); group.append("Server", null); group.append("Client", null); append(group); addCommand(cmd_OK); addCommand(cmd_BACK); setCommandListener(this); } public void commandAction(Command c, Displayable arg1) { if(c == cmd_OK) { boolean isServer = group.getSelectedIndex() == 0? true : false; this.gameMidlet.newNetGame(isServer); } if(c == cmd_BACK) { gameMidlet.gameMenuCanvasBack(); } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -