tags:

views:

18

answers:

1

who we change the width of the button. i am use 2 buttons. i want display on all width of the screen.

A: 
class Main extends UiApplication {
 public Main(){
        pushScreen(new TestScreen());
    }

    public static void main(String args[])
    {
        Main app = new Main();
        app.enterEventDispatcher();
    }
} 



class TestScreen extends MainScreen {

    public TestScreen() {
           ButtonField bt = new ButtonField("all width"){
               public int getPreferredWidth() {
                    return net.rim.device.api.system.Display.getWidth();
                }
        };
        this.add(bt);
    }
}
oxigen