Skip to main content

Adding components to menu bar in LWUIT 1.4

Please note these forums are being decommissioned and use the new and improved forums at
2 replies [Last post]
Joined: 2010-12-15

hi all,

I am facing a strange issue while trying to add a component to the menu bar. I am able to see the component getting added during tracing using the ide, but it is not getting reflected on the screen.The following is the code i am using to implement the functionality.

MenuBar temp = (MenuBar) this.getMenuBar(); // "this" refers to the class , and it inherits form
restoreMenu(); //made protected for testing

kindly help me in this regard,

thank you

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-11-07

I suggest you go through the source code of the menu bar. You need to process commands and implement the softkey/menu logic, instead you are removing components that LWUIT relies on. This will obviously break badly.

What you need to do is derive the menu bar class and override methods within it. You replace the menu bar class via the LookAndFeel class.

Joined: 2010-12-15

Thank you Vprise