Search code examples
lwuitlwuit-form

How to specify the placement of a command on lwuit Form?


I have a lwuit form. I wish to add my command to the right soft button.

I don't want to use Display.getInstance().reverseSoftButtons. How do i do it?

I came a across this method:

form.addCommand(myCommand, (int) );

What is the second parameter in the above method? How do i specify it? I tried putting in values like 1,3 but it gives me an exception. The documentation says it stands for offset. What is this offset and how do i specify it?


Solution

  • The second parameter is the offset within the array of commands, its in the javadoc.

    You can add a blank "" command or use reverse softbuttons to get such an effect. In LWUIT 1.5 or newer you can also derive MenuBar and replace it using the UIManager API.