JDK-4435617 : JTabbedPane now throws exception when -1 passed to setSelectedIndex
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.1
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: generic
  • Submitted: 2001-04-09
  • Updated: 2001-05-01
  • Resolved: 2001-05-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.0 betaFixed
Related Reports
Relates :  
Description
   A merlin bug fix (4287053) which was aimed at making JTabbedPane
   exception throwing more consistent and clearly documented, 
   has resulted in an incompatibility that is causing problems for
   at least two real applications we are aware of: IntelliJ and
   JBuilder.
   
   Essentially, the setSelectedIndex() method of JTabbedPane previously
   accepted a value of -1 as valid, which was used internally to
   clear the selection when no tabs were present.  The fix modified
   setSelectedIndex() to throw an IndexOutOfBoundsException for the
   -1 case (consistent with other JTabbedPane methods).
   
   Now that we've discovered programs were depending on this 
   undocumented behavior, we believe we should document and fix
   setSelectedIndex() to again accept a value of -1 to clear the
   selection.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta FIXED IN: merlin-beta INTEGRATED IN: merlin-beta
14-06-2004

EVALUATION Since this breaks 2 key real world Swing applications, we should revert setSelectedIndex back to it's original behavior of accepting -1 to clear the selection. We should also document this clearly. amy.fowler@Eng 2001-04-09
09-04-2001