Search code examples
java-mecommandlwuit

LWUIT 1.4 Plain commands Vs. Styled commands with LWUITTheme.res


I've just started to develope an LWUIT MIDlet with standard LWUITTheme.res. I added 2 commands (Exit, Search) on my first form, but they appear with no style (black on white).

Commands rendere with no style

Instead, other 2 commands (Back, Details) on a second form, showed on Search command click, are rendered styled in white on blue, with a blue gradient background.

Commands rendere with style

The first form has a BorderLayout, the second has no particular layout set.

Since I haven't changed commands style in my code, I would expect that their appearance be the same in the first as in the second form, and precisely as they appear in the second form.

Am I wrong?

Regards

--

After @Bhakki first reply, regarding SoftButtons, I've checked the {$LWUIT_FOLDER}/LWUITDemo/src/LWUITTheme.res file.

Command and SoftButton unselected appearing in LWUITTheme.res

As you can see, both Command and SoftButton has in the .res file. It seems that the commands in the first form are styled as Command, and those in the second form are styled as SoftButton.

But I added them in the same way in both forms.

Am I doing something wrong?


Solution

  • You created the first form before installing the theme. You need to install the LWUIT theme before you create components but after Display.init().