How to remove the Title-bar of a LWUIT Form?
-
19-02-2021 - |
Frage
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?
Lösung
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();
Andere Tipps
You could also just do
form.getTitleArea().setVisible(false);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow