Missing horizontal scrollbar

Dear all,

I am struggling with layout and scrollbars:
Below code shows a horizontal layout with buttons and a vertical layout with buttons.
If the window is resized a vertical scrollbar appears as expected, however no horizontal scrollbar is shown.

setSizeUndefined (as suggested by the Vaadin book and in some posts) doesn’t make any difference.

What do I do wrong here?

Regards,
Joost


public class MyVaadinApplication extends Application
{
	static Logger log = Logger.getLogger(MyVaadinApplication.class);

	public void init()
	{
		Window main = new Window("My Vaadin Application");
		setMainWindow(main);
		main.setSizeUndefined();
		
		HorizontalLayout hl = new HorizontalLayout();
		hl.setSizeUndefined();
		main.addComponent(hl);
		
		for (int i = 0; i < 10; ++i)
		{
			hl.addComponent(new Button("Hbutton " + i));
		}
		
		VerticalLayout vl = new VerticalLayout();
		main.addComponent(vl);
		
		for (int i = 0; i < 10; ++i)
		{
			vl.addComponent(new Button("Vbutton " + i));
		}
	}
}

Try this:

main.getContent().setSizeUndefined();

main has an undefined size, but its content is by default VerticalLayout with 100% width.

That helped!

Thanks,
Joost