Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Layout formatting

Alex Viscreanu
7 years ago Aug 06, 2015 4:46pm
Anna Koskinen
7 years ago Aug 11, 2015 3:07pm


Expand ratio should fix your problem. Something like this:

horizontalLayout.setExpandRatio(label, 1);

If you only have one component with expand ratio set, all the extra space goes to that component. The flip side is that if you run out of space, that same component is the one that gets cut off.

Alex Viscreanu
7 years ago Feb 24, 2016 1:06pm