- 論壇徽章:
- 0
|
NetBeans IDE 3.5.1如何擴展安裝j2me的類庫,在NetBeans里調(diào)試MIDlet程序,我在NetBeans IDE 3.5.1里寫了helloworld,可是它出現(xiàn)如圖的錯誤提示:包javax.microedition.midlet不存在。但是我用J2ME_Wireless_Toolkit編譯,運行成功。所以我懷疑是不是我裝的J2SDK Standard Edition 1.4.2沒有javax類的,請問如何安裝(擴展),要不在NetBeans里是不可以調(diào)試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();
}
}
} |
|