📄 readinfoform.java
字号:
package myim.ui;
import javax.microedition.lcdui.*;
/**
* 阅读信息界面
*/
public class ReadInfoForm extends Form implements CommandListener {
/**显示控制对象*/
private Display display;
/**用户名*/
private String userName;
/**用户列表界面*/
private UserList ul;
/**用户id*/
private String id;
/**用户信息*/
private String[] msg;
/**返回按钮*/
private Command cmdBack;
/**回复按钮*/
private Command cmdReply;
public ReadInfoForm(Display display,String userName,String[] msg,UserList ul,String id) {
super(userName);
this.display = display;
this.userName = userName;
this.msg = msg;
this.ul = ul;
this.id = id;
initUI();
}
private void initUI() {
//注册事件监听器
setCommandListener(this);
cmdBack = new Command("返回",Command.BACK,1);
cmdReply = new Command("回复",Command.OK,1);
addCommand(cmdBack);
addCommand(cmdReply);
//初始化信息
for(int i = 0;i < msg.length;i++){
append(msg[i]);
}
}
public void commandAction(Command c, Displayable d) {
//返回按钮
if(c == cmdBack){
display.setCurrent(ul);
}
//回复按钮
if(c == cmdReply){
display.setCurrent(new SendInfoForm(display,userName,id,this));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -