- 论坛徽章:
- 0
|
NetBeans IDE 3.5.1如何扩展安装j2me的类库,在NetBeans里调试MIDlet程序,我在NetBeans IDE 3.5.1里写了helloworld,可是它出现如图的错误提示:包javax.microedition.midlet不存在。但是我用J2ME_Wireless_Toolkit编译,运行成功。所以我怀疑是不是我装的J2SDK Standard Edition 1.4.2没有javax类的,请问如何安装(扩展),要不在NetBeans里是不可以调试j2me程序了?
程序如下:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class HelloWorld extends MIDlet implements CommandListener {
private Command exitCommand;
private TextBox tb;
public HelloWorld(){
exitCommand =new Command("Exit",Command.EXIT,1);
tb =new TextBox("Hello MIDlet","Hello,World!",15,0);
tb.addCommand(exitCommand);
tb.setCommandListener(this);
}
protected void startApp(){
Display.getDisplay(this).setCurrent(tb);
}
protected void pauseApp(){
}
protected void destroyApp(boolean u){
}
public void commandAction(Command c,Displayable d){
if (c ==exitCommand){
destroyApp(false);
notifyDestroyed();
}
}
} |
|