---
title: "getTabComponentAt和getComponentAt"
author: "eleopard"
date: "2011-04-14T10:48:54Z"
tags: []
categories: ["编程语言"]
slug: "gettabcomponentat-getcomponentat"
draft: false
lastmod: "2011-04-14T10:48:54Z"
id: 1002609
url: "https://eleopard.iteye.com/blog/1002609"
---

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.


```java
// 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"));
```