lwuitnokia-s40

LWUIT: How to show menu commands with another button


In LWUIT we could add the commands button right into the Form with addCommand function like in this link http://lwuit.java.net/tutorial/events.html . Because I am currently developing the Nokia Asha Full Touch Apps soto show those commands I could simply click it at the top left button.

However, I've created the custom title bar, so now I have the Button inside the container as the title bar I've made

The custom bar I've made

The 3 stripes above is the button with an image.

Do LWUIT have something like show menu like Android have Activity.openOptionMenu does?

Best Regards


Solution

  • Hi there!(my first post in stackoverflow)

    You have to use PopupList component of com.nokia.mid.ui. There is no problem to use this with LWUIT.

    PopupList javadoc

    As you can see in the javadoc. It is the example:

    PopupList list1 = new PopupList();
    PopupListItem item1 = new PopupListItem("Item1");
    PopupListItem item2 = new PopupListItem("Item1", image1);
    list1.appendItem(item1);
    list1.appendItem(item2);
    list1.setVisible(true);
    

    The position of the menu will be good to your target.