Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4435617

JTabbedPane now throws exception when -1 passed to setSelectedIndex

    Details

    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      generic
    • OS:
      solaris_10

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                amfowler Anne Fowler (Inactive)
                Reporter:
                amfowler Anne Fowler (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: