HorizontalLayout and component expanding

I am putting two components into a HorizontalLayout:

HorizontalLayout layout = new HorizontalLayout();
layout.addComponent(new Table()); 
layout.addComponent(new Form());//implementation details about table and form omitted

How can I made form to take the only needed space, and table to fill rest of space? I mean, I would like to have similar proportions: 70% table (left), 30% form (right)(without using horizontal split panel), but proportions should depend on the space taken by form.

Have you tried this?


HorizontalLayout layout = new HorizontalLayout();
Table table = new Table();
layout.addComponent(table); 
layout.addComponent(new Form());

layout.setExpandRatio(table, 1);

Of course, but form disappears then. I replaced form with just plain button to check and everything is fine. It has to be something with form.

EDIT: Finally got it. I just had to call setSizeUndefined() on form.