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) {
}
}