以上是电话日历的j2me代码,网上复制的,新建项目,eclise 没查出错,但debug运行不了,请大家帮查下原因?

zspmb 2009-04-11 10:30:29
// Import of API classes
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.util.*;
//A first MIDlet with simple text and a few commands.
public class PhoneCalendar extends MIDlet
implements CommandListener, ItemStateListener {
//The commands
private Command exitCommand;
//The display for this MIDlet
private Display display;
// Display items e.g Form and DateField
Form displayForm;
DateField date;
public PhoneCalendar() {
display = Display.getDisplay(this);
exitCommand = new Command("Exit", Command.SCREEN, 1);
date = new DateField("Select to date", DateField.DATE);
}
// Start the MIDlet by creating the Form and
// associating the exit command and listener.
public void startApp() {
displayForm = new Form("Quick Calendar");
displayForm.append(date);
displayForm.addCommand(exitCommand);
displayForm.setCommandListener(this);
displayForm.setItemStateListener(this);
display.setCurrent(displayForm);
}
public void itemStateChanged(Item item)
{
// Get the values from changed item
}
// Pause is a no-op when there is no background
// activities or record stores to be closed.
public void pauseApp() { }
// Destroy must cleanup everything not handled
// by the garbage collector.
public void destroyApp (boolean unconditional) { }
// Respond to commands. Here we are only implementing
// the exit command. In the exit command, cleanup and
// notify that the MIDlet has been destroyed.
public void commandAction (
Command c, Displayable s) {
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}
}
...全文
71 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
JarodYv 2009-04-11
  • 打赏
  • 举报
回复
可以正常运行,也可以Debug。是不是你的Debug超时时间设的太短了?

13,100

社区成员

发帖
与我相关
我的任务
社区描述
Java J2ME
社区管理员
  • J2ME社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧