📄 newsms.java
字号:
import java.io.IOException;
import java.util.Enumeration;
import java.util.Vector;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.TextBox;
public class NewSms extends TextBox implements CommandListener
{
Command ok,back;
public NewSms(String title, String text, int maxSize, int constraints)
{
super(title, text, maxSize, constraints);
ok=new Command("确定",Command.BACK,1);
back=new Command("返回",Command.EXIT,2);
addCommand(ok);
addCommand(back);
setCommandListener(this);
}
public void commandAction(Command c, Displayable d)
{
if(c.equals(ok))
{
String str=getString();
SmsMIDlet.v.addElement(str);
Alert al=new Alert("保存成功","备忘录已存",null,null);
al.setTimeout(500);
SmsMIDlet.midlet.showAddNew(al);
}else if(c.equals(back))
{
SmsMIDlet.midlet.showSmsMain();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -