【J2ME】TextBox
来源:互联网 发布:linux sleep 实现 编辑:程序博客网 时间:2024/05/17 04:29
package cn.edu.zucc.exp1;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class MyMidlet extends MIDlet implements CommandListener {
private Display display;
private Form form = null;
private Command exit;
private Command ok;
private Command clear;
private TextBox textbox;
public MyMidlet() {
display = Display. getDisplay_r(this);
}
public void startApp() {
exit = new Command("exit", Command.EXIT, 1);
ok = new Command("ok", Command.SCREEN, 2);
clear = new Command("clear", Command.SCREEN, 2);
textbox = new TextBox("TextBox", "", 30, TextField.ANY);
textbox.addCommand(ok);
textbox.addCommand(clear);
textbox.setCommandListener(this);
form = new Form("MyMidlet");
form.addCommand(exit);
form.setCommandListener(this);
display.setCurrent(textbox);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
notifyDestroyed();
}
public void commandAction(Command c, Displayable d) {
if (c == ok) {
String str = textbox. getString_r();
form.append(str);
display.setCurrent(form);
} else if (c == clear) {
textbox.setString(null);
} else {
destroyApp(true);
}
}
}
- 【J2ME】TextBox
- j2me中TextBox组件
- J2ME学后感--TextBox
- j2me TextBox用法
- j2me-list类、textbox类、ticker类
- J2ME的List、TextBox,Ticker和Alert
- J2ME中输入文本TextBox的输入格式限制
- J2ME中输入文本TextBox的常用方法练习
- TextBox
- textbox
- textbox
- TextBox
- TextBox
- textbox
- TextBox
- j2me
- j2me
- J2ME
- 实现合并多行字符串(整理)
- 活动对象-同步调用
- 在上海、迪拜、深圳过马路
- Jquery 实现html table 行 Tr 的复制
- 工作年限==工作经验?
- 【J2ME】TextBox
- ODI KM二次开发手册
- 思考人生[1]
- 编写包含多个功能子程序的中断例程
- 一年了~~~
- 您试图在此 Web 服务器上访问的 Web 应用程序当前不可用
- MyEclipse Spring Hibernate整合开发
- CASE函数
- 丑陋电影/电视剧搜索引擎出炉