Question

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?

Was it helpful?

Solution

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

OTHER TIPS

You could also just do

form.getTitleArea().setVisible(false);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top