今天群里有人问怎么做?一直报报jvm error 104:illegalargumentexception
其实很简单,官方都有例子可以看。
我估计应该是没有clean自己jde下的垃圾东西或者jde配置不对造成的参数错误。
package newpackage;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.PopupScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
/**
*
* @author Tiandi Zhang
*/
public class Demo extends UiApplication {
public static void main(String[] args){
Demo theApp = new Demo();
theApp.enterEventDispatcher();
}
public Demo(){
pushScreen(new mainscreen());
}
}
class mainscreen extends MainScreen{
public mainscreen() {
super();
LabelField title = new LabelField("Popup Demo",LabelField.ELLIPSIS|LabelField.USE_ALL_WIDTH);
setTitle(title);
ButtonField b1 = new ButtonField("Popup a Screen",ButtonField.CONSUME_CLICK);
add(b1);
b1.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
UiApplication.getUiApplication().pushScreen(new pscreen());
}
});
}
}
class pscreen extends PopupScreen{
public pscreen(){
super(new VerticalFieldManager(),Field.FOCUSABLE);
add(new LabelField("This is a popup screen."));
}
}