鍍金池/ 教程/ Java/ UI 布局-TabSheet 布局
UI 組件-自定義組件
UI 布局-Panel
UI 組件-Slider 組件
UI 組件-Button
UI 組件-PasswordField
UI 布局-TabSheet 布局
Vaadin Web 應(yīng)用的基本組成部分
UI 組件-Label
UI 組件-Link
UI 布局-GridLayout 布局
安裝開發(fā)環(huán)境
UI 組件-Tree 組件
UI組件-Select 組件
UI 布局-概述
UI 組件-RichTextArea
UI 組件-Table 組件
使用 Item 介面管理一組 Property
使用資源
UI 組件-TextArea
SQLContainer-編輯
SQLContainer-過濾及排序
UI 組件-TextField
UI 布局-HorizontalSplitPanel 和 VerticalSplitPanel 布局
SQLContainer-引用其它 SQLContainer
UI組件-ProgressIndicator組件
開始編寫 Web 應(yīng)用
UI組件-Form組件
UI 布局-Accordion 布局
SQLContainer-使用 FreeformQuery
SQLContainer 概述
使用主題-創(chuàng)建和應(yīng)用新主題
概述
UI 布局-AbsoluteLayout 布局
UI 組件-Upload 組件
使用主題-概述
UI 布局-FormLayout 布局
MenuBar 組件
UI 布局-VerticalLayout 和 HorizontalLayout 布局
UI 組件-Embedded 組件
UI 組件概述
使用 Container 介面管理一組 Item
UI 組件-LoginForm 組件
數(shù)據(jù)綁定-Property 接口
Vaadin 應(yīng)用程序框架介紹
開始使用 SQLContainer
UI 組件-Checkbox
可視化界面編輯插件
數(shù)據(jù)綁定-概述

UI 布局-TabSheet 布局

TabSheet 布局支持標(biāo)籤顯示。TabSheet 布局通過方法 addTab()添加一個標(biāo)籤頁。

// Create an empty tab sheet.
TabSheet tabsheet = new TabSheet();

// Make the tabsheet shrink to fit the contents.
tabsheet.setSizeUndefined();

tabsheet.addTab(new Label("Contents of the first tab")).setCaption("first");
tabsheet.addTab(new Label("Contents of the second tab")).setCaption("second");
tabsheet.addTab(new Label("Contents of the third tab")).setCaption("third");

http://wiki.jikexueyuan.com/project/vaadin-web-development-tutorial/images/86.png" alt="" />

每個標(biāo)籤頁為一 Tab 對象,可以顯示標(biāo)題和圖標(biāo)。

tabsheet.addTab(new Label("Contents of the second tab"),
          "Second Tab",
          new ClassResource("images/Venus_small.png", this));

用戶點(diǎn)擊標(biāo)籤時觸發(fā) TabSheet.SelectedTabChangeEvent 事件,獲取當(dāng)前選中的標(biāo)籤的方法為getSelectedTab(),同樣將某個標(biāo)籤設(shè)為當(dāng)前頁為 setSelectedTab()。

Tags: Java EE, Vaadin, Web