user806574
user806574

Reputation:

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

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?

Upvotes: 1

Views: 791

Answers (2)

albertosh
albertosh

Reputation: 2526

You could also just do

form.getTitleArea().setVisible(false);

Upvotes: 0

bharath
bharath

Reputation: 14453

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();

Upvotes: 2

Related Questions