JDK-4870636 : RFE: Option to have close(x) button on JTabbedPane
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.1
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2003-05-28
  • Updated: 2005-03-17
  • Resolved: 2005-03-17
Related Reports
Duplicate :  
Description

Name: jk109818			Date: 05/28/2003


A DESCRIPTION OF THE REQUEST :
An option to have a close(x) button on a tabbed pane would be very useful.

JUSTIFICATION :
Applications which we develop require for tabs to be added at runtime. Also the relevance of these data is not for the entire lifetime of the application.

Plus, when a dynamic addition and removal is allowed programmatically, a button allowing the user to do the same should also be available.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
There should be a close button (x-button) on the top right corner of each tab, which should preferably have a mouseover highlight and which when on clicking should cause the tab to close.
ACTUAL -
No such functionality is presently available.

CUSTOMER SUBMITTED WORKAROUND :
Presently I have subclassed the JTabbedPane class and overridden paint() and installed my own EventListener to handle mouse over property changes.
(Review ID: 186259) 
======================================================================

Comments
EVALUATION Currently we do not support adding of components to the tabs so it must be done via subclassing as you stated. Many platforms that have tabs don't support a close button as a behavior. This type of behavior should be able to be accomplished with the new work to allow components in the tabs of a tabbed pane. ###@###.### 2003-05-30
30-05-2003