一个 HelloWorld 抛出的 ClassNotFoundException
这是我的HELLO WROLD 文件:
package greeting;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class MIDletTest extends MIDlet implements CommandListener
{
private Display display ;
private TextBox textBox ;
private Command quitCommand;
public void startApp()
{
display = Display.getDisplay(this);
quitCommand = new Command("Quit", Command.SCREEN, 1);
textBox = new TextBox("Hello World", "My first MIDlet", 40, 0);
textBox .addCommand(quitCommand);
textBox .setCommandListener(this);
display .setCurrent(textBox );
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command choice, Displayable displayable)
{
if (choice == quitCommand)
{
destroyApp(false);
notifyDestroyed();
}
}
}
文件名叫 MIDletTest.java
以下是描述:
Unable to create MIDlet MIDletTest
java.lang.ClassNotFoundException: MIDletTest
at com.sun.midp.midlet.MIDletState.createMIDlet(+14)
at com.sun.midp.midlet.Selector.run(+22)
Execution completed.
我在模拟器上运行时发现这个错误。请问如何解决?