O'Reilly logo

Vaadin 7 UI Design By Example Beginner's Guide by Alejandro Duarte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – expanding components

Follow these steps to get rid of that gap:

  1. VerticalLayout (and other layouts too) has a method to specify how contained components should expand. Try adding this line to the MainLayout constructor:
    setExpandRatio(lowerSection, 1);
  2. Run the application.

What just happened?

Take a look at the resulting layout:

What just happened?

Think of expand ratios as the amount of space that some component can take inside its parent layout expressed as a ratio. Initially, upperSection and lowerSection had both an undefined expand ratio, which means that, to be fair, each could take at most 50 percent of the space in the parent layout. We haven't assigned ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required