O'Reilly logo

LWUIT 1.1 for Java ME Developers by Biswajit Sarkar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

BoxLayout

This layout manager places widgets along a row or a column in accordance with the specified orientation. The code for using BoxLayout in our sample MIDlet is given below.

/*****Start of BoxLayout statements*****/
BoxLayoutBoxLayout MIDletBoxLayout testLayout = new BoxLayout(BoxLayout.X_AXIS);
//BoxLayout testLayout = new BoxLayout(BoxLayout.Y_AXIS);
demoForm.setLayout(testLayout);
demoForm.setTitle("BoxLayout");
//demoForm.setScrollableX(true);
tLabel.setFocusable(true);
imLabel.setFocusable(true);
bothLabel.setFocusable(true);
demoForm.addComponent(tLabel);
demoForm.addComponent(imLabel);
demoForm.addComponent(bothLabel);
/*****End of BoxLayout statements*****/

BoxLayout has one constructor, which takes an orientation field as its ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required