JDK-6255191 : After removing the Tab component, the initial title of the Tab does not come back.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2005-04-14
  • Updated: 2011-01-19
  • Resolved: 2005-04-14
Related Reports
Duplicate :  
Description
After removing the Tab component, the initial title of the Tab does not come back.

Please compile and run the attached test case with the latest Swing PIT (Containing the fix for Tabs as JComponent). 

Steps to reproduce: 
------------------
1) Compile and run the attached test case. 
2) Notice the title of Tab 1. It is "This is tab".
3) Now Click on "Add Tab Component" Button. Notice that a button is added to the tab. 
4) Now click on the "Remove the button on Tab" button. The Button is removed. 
5) Notice that the tab title is empty. Where as it should be "This is Tab".

###@###.### 2005-04-14 10:44:31 GMT

Comments
EVALUATION Closed as duplicate of 6252222: Adding a tab component to another parent should clean up tabbed pane because test attached adds tabComponent to another panel and this cause a problem according to JTabbedPane.setTabComponentAt() javadoc *A null value means * <code>JTabbedPane</code> will render the title and/or icon for * the specified tab. so having tabbedPane.setTabComponentAt(0,null); insetad of panel.add(button); in line 73 fixes the problem ###@###.### 2005-04-14 11:47:09 GMT
14-04-2005