How to launch a LWUIT form from a LCDUI form?

2019-07-31 14:33发布

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条回答
来,给爷笑一个
2楼-- · 2019-07-31 14:41

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);
查看更多
登录 后发表回答