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 ...

Get Vaadin 7 UI Design By Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.