📄 inputform.java
字号:
package qian;import javax.microedition.lcdui.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class InputForm extends Form implements CommandListener { StringItem stringItem1; TextField textField1; GameCanvas gc; public InputForm(GameCanvas canvas) { super("积分榜"); gc = canvas; try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { stringItem1 = new StringItem("您的名字:", ""); textField1 = new TextField("", "", 15, TextField.ANY); textField1.setLabel(""); stringItem1.setText(""); stringItem1.setPreferredSize(95, 16); setCommandListener(this); addCommand(new Command("确定", Command.OK, 1)); addCommand(new Command("取消", Command.CANCEL, 2)); this.append(stringItem1); this.append(textField1); } public void commandAction(Command command, Displayable displayable) { if (command.getCommandType() == Command.CANCEL) { } else { gc.addPlayer(textField1.getString(), gc.score ); } gc.status = 1; Qianmain.instance.setScreen(gc); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -