这个问题在之前的一些问题中已经间接谈到,但我还没有看到任何决定性的内容..
我目前正在使用这段代码在 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 提供某种浏览器控件?
最佳答案
解决了。现在可以了。只需将 com.sun.lwuit.Display.init(this);
放入 startApp()
并改变
RechForm.addComponent(BorderLayout.CENTER, htmlc);
到
RechForm.addComponent(htmlc);
关于java - 如何从 LCDUI 表单启动 LWUIT 表单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14893318/