这个问题在前面的一些问题中已经间接地谈到了,但我还没有看到关于它的任何决定性的东西。
我目前正在使用这段代码在CommandAction实现中显示一个LWUIT表单。
public void commandAction(Command cmnd, Item item) {
if (item == LogIn && cmnd == maincommand) {
RechForm = new com.sun.lwuit.Form("Basefook");
HttpRequestHandler handler = new HttpRequestHandler();
HTMLComponent htmlc = new HTMLComponent(handler);
htmlc.setPage("http://facebook.com");
RechForm.addComponent(BorderLayout.CENTER, htmlc);
com.sun.lwuit.Display.init(this);
RechForm.show();
}
}目前,它不会打开窗体,也不会崩溃。
好吧,如果这是不可能的,那么你能为基于lcdui的MIDP提供一些浏览器控制的变通方法吗?
发布于 2013-02-15 20:53:15
解决了it.It now works.Just将com.sun.lwuit.Display.init(this);放入startApp()并更改
RechForm.addComponent(BorderLayout.CENTER, htmlc);至
RechForm.addComponent(htmlc);https://stackoverflow.com/questions/14893318
复制相似问题