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

Scrollable tab button of JTabbedPane is not disabled when reaches the last tab

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • client-libs
    • beta
    • generic
    • generic
    • Verified

      Scrollable tab button of JTabbedPane is not disabled when reaches the last tab in the JTabbedPane .

      The above behaviour is noticed only when the size of the JtabbedPane is less than the size of a single tab. It works fine when JTabbedPane is resize to more than the size of a single tab.

      Find attached test case with the bug report.

      To Reproduce the bug :

      1) Compile and run the attached Java File.
      2) Click on the scroll button until it reaches the last tab. Check to see if the scroll button is still enabled/disabled. It should be disabled when reaching the last tab.

      This Results in the following exception.

      Exception occurred during event dispatching:
      java.lang.ArrayIndexOutOfBoundsException
              at javax.swing.plaf.basic.BasicTabbedPaneUI$ScrollTabsForwardAction.actionPerformed(BasicTabbedPaneUI.java:1823)
              at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1580)
              at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1634)
              at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:379)
              at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:251)
              at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:247)
              at java.awt.Component.processMouseEvent(Component.java:4137)
              at java.awt.Component.processEvent(Component.java:3963)
              at java.awt.Container.processEvent(Container.java:1247)
              at java.awt.Component.dispatchEventImpl(Component.java:2892)
              at java.awt.Container.dispatchEventImpl(Container.java:1309)
              at java.awt.Component.dispatchEvent(Component.java:2764)
              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3029)
              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2783)
              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2742)
              at java.awt.Container.dispatchEventImpl(Container.java:1283)
              at java.awt.Window.dispatchEventImpl(Window.java:1228)
              at java.awt.Component.dispatchEvent(Component.java:2764)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:423)
              at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:136)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:122)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:118)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: