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

Tab sheets

A TabSheet allows users to alternate between views by using tabs. A user only sees the content of one tab at a time. Tabbed views are useful to logically break content up so users can more comfortably work with some components in a large area than if we put all the components in a single view.

To create an empty tab sheet, instantiate a new TabSheet object like this:

TabSheet tabs = new TabSheet();

You have two ways to add tabs. You can use the addTab method that takes two parameters, the first is the component that will go inside the tab, and the second is the title for the tab itself:

tabs.addTab(new Label("Label 1"), "Tabl 1");

Or you can use the addTab method that takes only one parameter, the component to add inside the tab. This method ...

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