开发者

J2ME LWUIT Menubar three Softbuttons and Style

开发者 https://www.devze.com 2023-03-22 02:56 出处:网络
I\'m using lwuit-current with Java ME on Nokia S40 phones. I\'d like to imitate the style as much as possible to the default look.

I'm using lwuit-current with Java ME on Nokia S40 phones.

I'd like to imitate the style as much as possible to the default look.

I discovered, there's commandBehavior native which gives the default look for the menuBar, which is very nice.

1.) I'm using three Buttons and would like to show them all the time - not only one Button + the Options Button, is this possible? See http://img194.imageshack.us/img194/8877/menubarx.jpg

开发者_JS百科

I tried Display.getInstance().setThirdSoftButton(true); but I still have an empty unused third button.

The SoftButtons where added via form.addCommand(buttonname);

2.) This native SoftButtons Layout also gives me the additional title with the program line + clock; see screenshot. Can this title be removed OR changed from LWUIT?

Thanks in advance.


Using native menus will not work with 3 softbutton mode since native menus effectively forfeit the control LWUIT has over that UI to the underlying OS. 3 softbutton mode requires deep knowledge of the UI and LWUIT has no MIDP API to communicate that knowledge to the device. The native title bar appearing in the top of the screen is a part of the devices UI which we can no longer control.

Furthermore, LWUIT's (and Nokia's) 3 softbutton mode is highly focus based which doesn't really make sense in a touch based UI where focus should have little or no meaning. Which is why I suggest you don't turn on the 3 softbutton mode.

You can easily style LWUIT to use a theme similar to the native theme, in order to have 3 buttons in the bar at the bottom of the screen you will need to subclass and replace the MenuBar class by setting the menu bar class in the LookAndFeel (which you get via the UIManager singleton).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号