Possible Duplicate:
Adding a button component to a java tabbed pane in java
Is it possible to add a button to a JTabbedPane tab (the tab itself) so that when clicked it could perform an action, for example close the tab?
Possible Duplicate:
Adding a button component to a java tabbed pane in java
Is it possible to add a button to a JTabbedPane tab (the tab itself) so that when clicked it could perform an action, for example close the tab?
Sure. First add a tab like this:
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.add( "title", content );
Then change the "title" label with this:
tabbedPane.setTabComponentAt( 0, new JButton( "This is now a button!" ) );
// 0 is the tabindex