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.

Expanding VerticalLayout Height

Eric Dobbs
1 decade ago Mar 18, 2010 4:36pm
Jens Jansson
1 decade ago Mar 19, 2010 8:23am

Panels and Windows (Windows extend Panels) have automatically a layout in it when you initialize it. This is something that many are not aware of and this may cause problems.

So when you want a component tree like this:

Window (mainWindow)
`- VerticalLayout (layout)

you actually get

Window (mainWindow)
 `- VerticalLayout (with no direct field in your program)
     `- VerticalLayout (layout)

with the code that you have. Use the getContent / setContent on Panel/Window to access and modify this middle layout.

I suggest you change your second last line, mainWindow.addComponent(layout); to mainWindow.setContnet(layout); to get rid of the extra layout. That might solve some of your problems.

If your problems still persists I think the problem is in the BaseView class.

Last updated on Mar, 19th 2010
Eric Dobbs
1 decade ago Mar 23, 2010 2:05pm