Skip to main content

Adding components to menu bar in LWUIT 1.4

2 replies [Last post]
ashwin_s22
Offline
Joined: 2010-12-15
Points: 0

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
temp.removeAll();
temp.addComponent(infoTab);
temp.revalidate();
restoreMenu(); //made protected for testing
this.revalidate();*/

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.
vprise
Offline
Joined: 2003-11-07
Points: 0

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.

ashwin_s22
Offline
Joined: 2010-12-15
Points: 0

Thank you Vprise