I think I need to create a button style in the LWUIT Resource Editor since I'm not able to change the background color and other properties of buttons in my J2ME app. I have no idea how to accomplish this, and all the tutorials and examples are very confusing and unhelpful.
So if I want to have a button with a custom style, how do I go about creating this in the resource editor, and then how do I access this in my app?
Thanks!
Suggested readings: Using Styles, Themes, and Painters with LWUIT and LWUIT Tutorial - Styles and Themes to understand the style concept.
First step you need to create a new theme. Open LWUIT resource editor and then create a new theme:
Then you have to add a button style for
Unselected,Selected,PressedandDisabledstyles as you wish (no need to do it for all of these just which ones needed, most commonlyUnselectedandPressed):Save your theme in a
.resfile (let sayMyTheme.res) clicking inSaveoption (please note a single.resfile may contain several themes). CopyMyTheme.resfile into your project, let say inresfolder and please don't forget to add this folder in project properties so when you generate yourjarfile it will be included. Finally load your theme like this: