📄 c0f3a71bed9a001b1a36b107245978e8
字号:
/*
* 缴费系统主程序
*/
package com.chapter16.bankbillClent;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class BankBillMidlet extends MIDlet implements CommandListener {
private Command exitCommand, commitCommand;
private List mainList;
Display display;
public BankBillMidlet() {
exitCommand = new Command("Exit", Command.EXIT, 1);
commitCommand = new Command("选择", Command.SCREEN, 1);
Image[] imageArray = null;
try {
Image icon = Image.createImage("/remote.png");
// 设置列表所需要的图像数组
imageArray = new Image[] {
icon,
icon,
icon
};
} catch (java.io.IOException err) {
// ignore the image loading failure the application can recover.
System.out.print("load failed ...");
imageArray = null;
}
String[] stringArray = {
"登陆",
"设置帐户信息",
"缴费"
};
mainList = new List("移动银行缴费系统", Choice.IMPLICIT, stringArray,
imageArray);
mainList.addCommand(exitCommand);
mainList.addCommand(commitCommand);
//设置命令监听对象
mainList.setCommandListener(this);
display = Display.getDisplay(this);
}
protected void startApp() throws MIDletStateChangeException {
display.setCurrent(mainList);
}
protected void pauseApp() {
}
protected void destroyApp(boolean p1) {
}
public void commandAction(Command c, Displayable d) {
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
} else if (c == commitCommand) {
if (d.equals(mainList)) {
switch (((List)d).getSelectedIndex()) {
case 0:
SignOnUI signForm = new SignOnUI(this,mainList);
display.setCurrent(signForm);
break;
case 1:
AccountInfoUI accinfoUI = new AccountInfoUI(this,mainList);
display.setCurrent(accinfoUI);
break;
case 2:
break;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -