Left and right menus in LWUIT form

Using the LWUIT framework to develop a mobile application. In LWUIT, by default, the first command is placed on the left and subsequent commands will be placed on the right menu of the form, including the command that is already placed on the form on the left. I need to add two menus to the form. The Elevator menu contains a general application such as Minimize, Back, and Exit. The right menu contains special commands, such as "Play audio", "Play video", etc. .... Initially, the left softbot of the form contains the text "Parameters", and the right soft button of the form contains the text "Menu". When the user selects "Parameters", a menu is displayed with the following commands: Minimize back Exit When the user selects the right soft button "Menu", the menu will be displayed with specific screen commands: Listen to audio Play video, etc. .... Commands in the right menu change from one form to another, while the left menu commands remain unchanged for all screens (forms). I know that the command menu can be customized by overriding "Form.createCommandList (Vector)", which returns a list. But here, in my case, I need two lists (menu). One to the left of the form, and the other to the right of the form. Please help me in solving this problem.

+7
java-me lwuit
source share
1 answer

The LWUIT menu is just a dialog containing a list (or buttons for the touch menu or almost everything you want), so to implement this, simply create a command with parameters and place it on the left soft button. When the options are clicked, just show the dialog with your "extra commands". Since List can take a command array or vector, something like this can be very simple. You can look at the code for MenuBar, which is pretty simple, you can also replace the menu bar component in the latest version of LWUIT (SVN at the moment), but this seems redundant for this particular use case.

+4
source share

All Articles