Option 1. Add them to a flowlayout container and add that container to the boxlayout.y Option 2. Override calcPreferredSize and set them to a custom width
There are more ways On Mon, 7 Jun 2021, 21:12 'P5music' via CodenameOne Discussions, < [email protected]> wrote: > There are only two Buttons with a round border over my CN1 app. > > I have an issue with the two buttons. I did not realize it before because > they had no border and no bg. > > I put them in a BoxLayout.y() container along with other components. > They are in different places of the vertical container but it does not > matter. > > They are horizontally centered, while one would expect they are on the > left. > But this is good for me because I want those buttons to be centered. > > The issue is that they are huge, the text is centered but the buttons span > the entire screen width. > > I just want them to be centered buttons that wrap their text. > I also tried enclosing each of them in a BorderLayout container but its > the same. > > Maybe I forgot some silly thing, but I do not know. > > Thanks in advance > > -- > You received this message because you are subscribed to the Google Groups > "CodenameOne Discussions" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/codenameone-discussions/de82d9d6-a2fe-4ebd-89a5-08f99c5f11c3n%40googlegroups.com > <https://groups.google.com/d/msgid/codenameone-discussions/de82d9d6-a2fe-4ebd-89a5-08f99c5f11c3n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/CAG90yJ0f-9DsfxCuOevHLy8JxrLq3wpQqL5rVJLBMJ-bp37kYw%40mail.gmail.com.
