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

JTabbedPane now throws exception when -1 passed to setSelectedIndex

XMLWordPrintable

    • beta
    • generic
    • solaris_10

         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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: