Search code examples
java-melwuitlwuit-form

how to autohide commands in LWUIT Form


I have a LWUIT Form which has 3 containers, each with its own content. Two commands('BackCommand' & 'ExitCommand') have been added to the form.

These commands are shown at the bottom of the screen. The commands hog up quite a lot of space on the screen. Can I auto hide these commands the way we can autohide a taskbar in windows?

Whenever the user pressed the left/right soft button, I want the two commands to pop-up and then become active for receiving events generated by the form.

How do I achieve this?


Solution

  • You need to derive the MenuBar class introduced in LWUIT 1.5 and override the functionality of the menu bar any way you like e.g. setting the MenuBar to visible "false" within the form.