public class HelloWorld extends MIDlet implements CommandListener { private Display display; public static final Command exitCommand = new Command("退出",Command.EXIT,1);
public HelloWorld(){}
public void startApp(){ if(display == null){ display = Display.getDisplay(this); } TextBox t = new TextBox("Netbeans", "出色的Java开发工具", 256, 0); t.addCommand(exitCommand); t.setCommandListener(this); display.setCurrent(t); }