百分相赠:helloworld问题
茂一茂 2006-02-19 11:07:05 import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class helloWorld extends MIDlet implements CommandListener
{
private Form mainForm;
private StringItem helloString;
public helloWorld(){
mainForm = new Form("Hello World Form");
mainForm.addCommand( new Command("Beenden", Command.EXIT, 0));
mainForm.setCommandListener(this);
helloString = new StringItem("Hello Label","\nHello World!");
mainForm.append(helloString);
}
public void commandAction(Command c, Displayable d) {
if (c.getCommandType() == c.EXIT ) {
destroyApp(false);
notifyDestroyed();
}
}
public void startApp() {
Display.getDisplay(this).setCurrent(mainForm);
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
}
上面是在网上拷来的
在Sun Java Wireless Toolkit运行时
出来以下错误 :
Unable to create MIDlet helloWorld_MIDlet
java.lang.ClassNotFoundException: helloWorld_MIDlet
at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
at com.sun.midp.midlet.Selector.run(+22)
是不是有什么问题呀?