* Cria o form
* @return
*/
public Form buildUI() {
Form mainForm = new Form("Hello LWUIT");
mainForm.setLayout(new CoordinateLayout(300, 300));
mainForm.setX(0);
mainForm.setY(0);
mainForm.setWidth(300);
mainForm.setHeight(300);
//Sair
final Button btnSair = new Button("Sair");
btnSair.setX(0);
btnSair.setY(22);
// Create buttons in the main form
final Label lblHello = new Label("Hello LWUIT");
ActionListener listener = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
if (evt.getSource() == btnSair) {
exit();
}
}
};
btnSair.addActionListener(listener);
mainForm.addComponent(lblHello);
mainForm.addComponent(btnSair);
mainForm.setCommandListener(listener);
return mainForm;
}