[codenameone-discussions] Re: How to center a container?

2021-05-20 Thread Shai Almog
You can use several strategies but the simplest one would be to use TableLayout roughly like this: TableLayout tl = new TableLayout(NUMBER_OF_BUTTONS, 1); Container f1 = new Container(tl); f1.add(tl.cc().ha(CENTER).wp(100), play); f1.add(tl.cc().ha(CENTER), movie); Notice the other lines

[codenameone-discussions] Re: How to center a container?

2021-05-20 Thread 'P5music' via CodenameOne Discussions
Maybe you should use BorderLayout so you can place the f1 container in the center of it. https://www.codenameone.com/javadoc/com/codename1/ui/layouts/BorderLayout.html Container f1 = new Container(BoxLayout.y()); Container blContainer = new Container(new BorderLayout()); Button