×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    6

    how to implement command in lwuit.

    hi I am beginner in lwuit. I can implement command in j2me but I can't implement in lwuit. please help.

    my code:::


    public class MidletNew extends MIDlet implements ActionListener {
    public void startApp() {


    Display.init(this);
    Form f=new Form("your information Here");

    //TextArea textArea = new TextArea(5, 20, TextArea.ANY);
    //textArea.setMaxSize(200)
    //textArea.setEditable(true);
    //f.addComponent(textArea);



    TextField name=new TextField("ur name",500);
    name.setMaxSize(200);
    name.setEditable(true);
    f.addComponent(name);


    TextField email =new TextField("email", 50);
    email.setMaxSize(50);
    email.setEditable(true);
    f.addComponent(email);


    TextField address=new TextField("address", 100);
    address.setMaxSize(200);
    address.setEditable(true);
    f.addComponent(address);

    TextField mobileNo=new TextField("mobile no", 50);
    mobileNo.setMaxSize(50);
    mobileNo.setEditable(true);
    f.addComponent(mobileNo);

    Command exitCommand=new Command("exit");
    f.addCommand(exitCommand);

    Command ok=new Command("ok");
    f.addCommand(ok);

    f.setCommandListener(exitCommand);
    f.show();




    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void actionPerformed(ActionEvent ae) {

    destroyApp(true);
    notifyDestroyed();

    throw new UnsupportedOperationException("Not supported yet.");
    }
    }




    help :::: my exit commant does not work in here. please help me....::::

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: how to implement command in lwuit.

    i'm really not sure about this line:

    f.setCommandListener(exitCommand);

    should probably be :

    f.setCommandListener(this);

Similar Threads

  1. how to add first command on right and others in left in LWUIT
    By Manish_Bansal in forum Mobile Java General
    Replies: 12
    Last Post: 2010-08-17, 06:51
  2. take the text of command on left to centre in lwuit
    By Manish_Bansal in forum Mobile Java General
    Replies: 3
    Last Post: 2010-07-08, 04:53
  3. How to implement AT command interpreter module in Symbian C++?
    By chase_sapph in forum General Development Questions
    Replies: 0
    Last Post: 2008-03-20, 05:01
  4. Implement AT Command to send SMS in 8051 Microcontroller or PIC
    By vikassrivastava1 in forum General Messaging
    Replies: 2
    Last Post: 2006-12-03, 10:57
  5. Replies: 0
    Last Post: 2004-03-04, 04:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×