EasyManua.ls Logo

Motorola T720 - Modify a Buttons Characteristics

Motorola T720
57 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
50
Modify a Button’s Characteristics
Let’s examine ButtonDemo’s constructor in more detail to see how LWT buttons are
made, and how their visibility and screen location can be changed. Scroll through the
Buttons.java file with the editor to find:
// The constructor for our screen
public ButtonScreen() {
// First button
b1 = new Button("Button");
add(b1);
// Second button, set to fill the screen
b2 = new Button("Large Button");
b2.setRightEdge(Component.SCREEN_RIGHT, 0);
b2.setBottomEdge(Component.HEIGHT,
b2.getPreferredHeight() * 2);
// b2.setVisible(false);
add(b2);
// Third button, disabled
b3 = new Button("Disabled Button");
b3.setEnabled(false);
add(b3);
// Fourth button, using the custom RoundButton class
b4 = new RoundButton("Round");
// b4.setEnabled(false);
// b4.setVisible(false);
add(b4);
// Fifth button, RoundButton class, located to right and
// level with the top of the previous button
b5 = new RoundButton("Round");
// b5.setLeftEdge(Component.PREVIOUS_COMPONENT_RIGHT,
0);
// b5.setTopEdge(Component.PREVIOUS_COMPONENT_TOP, 0);
// b5.setVisible(false);
add(b5);
// Assign each button a listener
b1.setComponentListener(this);
b2.setComponentListener(this);
b3.setComponentListener(this);
b4.setComponentListener(this);
b5.setComponentListener(this);

Other manuals for Motorola T720

Related product manuals