How to show two or more label at centre of the container in codenameone -


i new codenameone there option align label depends on label align bottom, top, right , left option?

how align many labels @ centre of parent layout?

here have attached code tried for:

container center = new container(new borderlayout());      label des = new label((string) data.get("title"));     des.setuiid("multiline2");     center.addcomponent(borderlayout.north,des);     label author = new label((string) data.get("author"));     author.setuiid("multiline2");     center.addcomponent(borderlayout.south,author);      cnt.addcomponent(borderlayout.center, center); 

i getting outpul below imagei getting outpul below image

here have attached need projectthis requirement

can please me how should requirement?

this place labels in absolute center of container:

form hi = new form("hi world"); hi.setlayout(new borderlayout(borderlayout.center_behavior_center_absolute)); container center = new container(new boxlayout(boxlayout.y_axis));  label line1 = new label("what doing"); label line2 = new label("hello");  center.add(line1); center.add(line2);  hi.addcomponent(borderlayout.center, center);  hi.show(); 

to adjust center move left can add right padding center container:

center.getallstyles().setpadding(component.right, 100); 

Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -