我打算在j2me开始我的第一课,我下载了一本简单的书,并尝试了我的第一个程序。 当我走第二步添加命令,我面临着一个错误信息是:J2ME未捕获异常
uncaught exception java/lang/noclassdeffounderror: readfile.
所以,请你帮我理解这条消息?以及如何解决它? 请在下面找到我的代码。
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class ReadFile extends MIDlet implements CommandListener
{
private Form form1;
private Command Ok, Quit;
private Display display;
private TextField text1;
public void startApp()
{
form1 = new Form("TA_Pog");
Ok = new Command("Ok", Command.OK, 1);
Quit = new Command("Quit", Command.EXIT, 2);
form1.setCommandListener(this);
form1.addCommand(Ok);
form1.addCommand(Quit);
text1 = new TextField("Put Your Name :","His Name : " , 32, TextField.URL);
form1.append(text1);
display = Display.getDisplay(this);
display.setCurrent(form1);
}
public void commandAction(Command c , Displayable d)
{
if (c == Ok)
{
Alert a = new Alert("Alert","This Alert from Ok Button", null, AlertType.ALARM);
a.setTimeout (3000);
display.setCurrent(a,this.form1);
}
else
{
this.notifyDestroyed();
}
}
public void pauseApp() {}
public void destroyApp(boolean bool) {}
}
注意:上面的代码完全取自一本书。
在此先感谢 BESR认为
你什么时候得到这个例外 – 2012-01-03 08:23:40