ITeye博客

getTabComponentAt和getComponentAt

eleopard · 2011-04-14 10:48 · Java · 编程语言 · Markdown

getTabComponentAt() returns the custom component you might add as the tab title. getComponentAt() returns the contents of a tab.

The tab component is the component that renders the tab--not the component that displays in the pane.

// In this case the look and feel renders the title for the tab.
tabbedPane.addTab("Tab", myComponent);
// In this case the custom component is responsible for rendering the title of the tab.
tabbedPane.addTab(null, myComponent);
tabbedPane.setTabComponentAt(0, new JLabel("Tab"));

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。