How can i set the Button location in LWUIT??
public void error()
{
error = new Dialog();
e = new Label("EMPTY FIELDS!!!");
t= new TextArea("You Can't Leave The Fields Empty...",8,13);
error.addComponent(e);
error.addComponent(t);
eok = new Button("Ok");
eok.setAlignment(Component.CENTER);
eok.addActionListener(this);
error.addComponent(eok);
error.show();
}
You need to use a layout manager. I'm guessing you are trying to center a button and not just align it to the center, just add it to a container with a center flow layout:
Container c = new Container(new FlowLayout(Component.CENTER));
c.addComponent(btn);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.