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

Absolute layouts

Sometimes we need to place a component in a very specific and exact place of the page. That's the whole point of using AbsoluteLayout. For a GridLayout we have to give the position on the grid, for an AbsoluteLayout we have to give the position on the page. The position must be given using CSS format. For example, to place a component 20 pixels from left and 30 pixels form top, we can do this:

absoluteLayout.addComponent(someComponent, "left: 20px; top: 30px");

Tip

You can use top, left, right, and bottom CSS identifiers to set the position of a component when using AbsoluteLayout. And of course, you can use any CSS unit such as %, in, cm, mm, px, pt, and so on.

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