I'm new in LWUIT. I have created a theme for my MIDlet and applied it. The background of the Form, the Label and font change as defined in the theme but the Buttons on the Form do not change like I have defined them in my theme. What could be the problem? Here is a snippet of my code.
import com.sun.lwuit.Button;
import com.sun.lwuit.Display;
import com.sun.lwuit.Form;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import java.io.IOException;
import javax.microedition.midlet.MIDlet;
public class mainMidlet extends MIDlet {
public void startApp()
{
Display.init(this);
Resources r;
try {
r = Resources.open(getClass().getResourceAsStream("res/TUNGtheme.res"));
UIManager.getInstance().setThemeProps(r.getTheme("Theme 2"));
} catch (IOException ex) {
//do something
}
Form f = new Form("App using LWUIT!");
f.show();
Button tuskysButton = new Button("Tuskys");
f.addComponent(tuskysButton);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
I suppose that the UIID that you defined for the
Buttonshas the right name. I mean in the ResourceEditor you have to apply the style for elements calledButton. If that is right, did you set selected and unselected style? If I can see a pair of screens from your Resource Editor, I could help you more.