How to remove the Title-bar of a LWUIT Form?

790 views Asked by At

In the actionPerformed of a Button I want to remove the Title-bar of the actual LWUIT Form. How to achieve that? And how to redisplay it again after a certain action has been complete?

2

There are 2 answers

0
bharath On BEST ANSWER

Use below code for hide/show the title of the Form in the Button action event,

final Form form = new Form("Sample");
form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));
final Container titleContainer = form.getTitleArea();
titleContainer.setVisible(false);
Button b = new Button("button");
b.addActionListener(new ActionListener() {

  public void actionPerformed(ActionEvent evt) {
    if (!titleContainer.isVisible()) {
       titleContainer.setVisible(true);
    } else {
       titleContainer.setVisible(false);
    }
    form.revalidate();
    }            
  });
form.addComponent(b);
form.show();
0
albertosh On

You could also just do

form.getTitleArea().setVisible(false);