importjavax.microedition.midlet.MIDlet;importjavax.microedition.midlet.MIDletStateChangeException;importjavax.microedition.lcdui.*;publicclassHelloWorldMidletextendsMIDle...
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.*;
public class HelloWorldMidlet extends MIDlet {
//TextBox类对应文本框,用于控制文本的输入,并显示输入
public TextBox textbox;
public HelloWorldMidlet() {
// TODO Auto-generated constructor stub
super();
}
protected void startApp() throws MIDletStateChangeException {
// TODO Auto-generated method stub
//新建一个名为"测试程序"的文本框,文本框内默认输入"Hello World"
textbox=new TextBox("测试程序","Hello World!",20,0);
//调用自己写的MyAdd接口
MyAdd();
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
//自己加入的新接口
public void MyAdd(){
//将textbox设为屏幕当前现实的对象
Display.getDisplay(this).setCurrent(textbox);
}
}
代码是照着书上写的,一运行就说java.lang.ClassNotFoundException 我一开始以为是环境没有配置,然后把环境变量配置了,可是还是报错,这可怎么办呀?
那位高手给我指点一下阿,谢谢了~
展开