Michał Herman
Michał Herman

Reputation: 3587

Vaadin - layout size to fit components

I have following situation: VerticalLayout with Labels inside it. (this layout is interrior of popup)
When I'm building the application I don't know lengths of the labels - the label contents are queried from database.

Is there any way to tell this VerticalLayout to have width enough to fit all labels without breaking them, but not bigger? I don't want labels to break, but I also don't want to have empty space in the popup.

Upvotes: 0

Views: 8598

Answers (1)

Charles Anthony
Charles Anthony

Reputation: 3155

By default, Vaadin labels have a width of 100%. You'll want to change that to "undefined", and the same for the VerticalLayout : In both cases setWidth(null) or setWidth(-1, UNIT_PIXELS)

Upvotes: 5

Related Questions