How to launch a LWUIT form from a LCDUI form?

江枫思渺然 提交于 2019-12-11 06:40:00

问题


The question has been indirectly spoken about in some of the earlier questions but i havent seen anything decisive about it..

I am currently using this piece of code to show a LWUIT form inside CommandAction implementation.

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();

}

}

Currently it doesnt bring up the form ,nor does it crash.

well if thats not possible then can you suggest a workaround to some sort of browser control for MIDP based of lcdui?


回答1:


Solved it.It now works.Just put the com.sun.lwuit.Display.init(this); into startApp() and change

RechForm.addComponent(BorderLayout.CENTER, htmlc);

to

RechForm.addComponent(htmlc);


来源:https://stackoverflow.com/questions/14893318/how-to-launch-a-lwuit-form-from-a-lcdui-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!