📄 topicnoscreen.java
字号:
/*
* 主题查询输入界面类topicNoScreen.java
*/
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import java.io.*;
public class topicNoScreen extends Form implements CommandListener {
StringBuffer searchInfo = new StringBuffer();
StringItem stringItem1 = new StringItem("", "");
TextField isbnField = new TextField("", "", 11, TextField.ANY);
/** 构造器 */
public topicNoScreen() {
super("Displayable Title");
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
/**组件初始化 */
private void jbInit() throws Exception {
isbnField.setLabel("请输入查询主题:");
//设置命令事件监听器
setCommandListener(this);
// 添加Submit命令与Exit命令对象
addCommand(new Command("Exit", Command.EXIT, 1));
addCommand(new Command("Submit", Command.SCREEN, 2));
this.append(stringItem1);
this.append(isbnField);
System.out.println("xxxx= " + search.search);
Display.getDisplay(search.search).setCurrent(this);
}
/**处理命令事件 */
public void commandAction(Command command, Displayable displayable) {
/** @todo Add command handling code */
if (command.getCommandType() == Command.EXIT) {
// 退出MIDlet
search.quitApp();
} //如果是提交命令责切换到图书信息显示屏幕。
else if (command.getCommandType() == Command.SCREEN) {
String topicNo = isbnField.getString();
Display.getDisplay(search.search).setCurrent(new searchInfoScreen(
topicNo));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -