lwuit-form

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:/

How to detect key pressed event in LWUIT form?

谁说我不能喝 提交于 2019-12-10 15:55:14
问题 I have written simple j2me program with LWUIT package.I have added one Form in my MIDLET class file. Suppose,user press a key then I want to show another Form .But I couldn't be able to capture key event in my LWUIT Form . This is my code snippt import javax.microedition.midlet.*; import com.sun.lwuit.*; import com.sun.lwuit.events.*; public class MultipleForm extends MIDlet implements ActionListener{ private Form mFirstForm, mSecondForm; public void startApp() { if (mFirstForm == null) {

How to call Exit Command when I press Key # in Lwuit Mobile Application?

雨燕双飞 提交于 2019-12-02 18:15:37
问题 Can I assign the Exit Command to the # key in an Lwuit Application? When I press the key # , the Exit command should be called automatically and exit the application. 回答1: You should listen for a KeyPress or keyReleased event on the form with the keycode for # and exitApplication when the # key is pressed. protected void keyPressed(int key) { System.out.println("Key Pressed"); if(key==52) //change 52 to match keyCode for # key { Display.getInstance().exitApplication(); } } 来源: https:/