0
當在模擬器中運行應用程序時,我在啓動時收到錯誤消息msg App Error 104 illegalmonitorstateexception。 從Eclipse內部沒有錯誤,模擬器可以在其他代碼上工作,因此我認爲沒有錯。Eclipse中沒有錯誤,但不會在Blackberry Simulator上運行。錯誤104 illegalmonitorstateexception
代碼:
package mypackage;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.LabelField;
class hello extends UiApplication {
hello() {
MainScreen SCREEN = new MainScreen();
SCREEN.setTitle("mygismo.com");
// CREATE STRING
String[] mymsgs = { "Cheese", "Pepperoni", "Black Olives" };
// AND INITIATE LOOP
for (int i = 0; i < 10; i++) {
// UPDATE SCREEN
SCREEN.add(new LabelField(mymsgs[i]));
pushScreen(SCREEN);
// WAIT 5 seconds
try {
wait(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public static void main(String args[]) {
hello APP = new hello();
APP.enterEventDispatcher();
}
}