JDK-4972427 : JTabbedPane throws ArrayIndexOutOfBoundsException when a new tab is inserted
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2003-12-24
  • Updated: 2004-01-13
  • Resolved: 2004-01-13
Related Reports
Duplicate :  
Relates :  
Description
JTabbedPane throws ArrayIndexOutOfBoundsException when a new tab is inserted.  I've seen a similar bug (4286825).  It looks like the bug was fixed, but I am still seeing problems.  

You can try to run attached java code.  Click "Test"/"Auto" ...
  java.lang.ArrayIndexOutOfBoundsException: 3
        at javax.swing.plaf.basic.BasicTabbedPaneUI.tabForCoordinate(BasicTabbedPaneUI.java:1267)
        at javax.swing.plaf.basic.BasicTabbedPaneUI.setRolloverTab(BasicTabbedPaneUI.java:485)
        at javax.swing.plaf.basic.BasicTabbedPaneUI.access$1100(BasicTabbedPaneUI.java:35)
        at javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mouseEntered(BasicTabbedPaneUI.java:3176)
        at java.awt.AWTEventMulticaster.mouseEntered(AWTEventMulticaster.java:241)
        at java.awt.Component.processMouseEvent(Component.java:5472)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3052)
        at java.awt.Component.processEvent(Component.java:5228)
        at java.awt.Container.processEvent(Container.java:1961)
        at java.awt.Component.dispatchEventImpl(Component.java:3931)
        at java.awt.Container.dispatchEventImpl(Container.java:2019)
        at java.awt.Component.dispatchEvent(Component.java:3779)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4203)
        at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4008)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3865)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3813)
        at java.awt.Container.dispatchEventImpl(Container.java:2005)
        at java.awt.Window.dispatchEventImpl(Window.java:1739)
        at java.awt.Component.dispatchEvent(Component.java:3779)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:231)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


This happens on Solaris (sun4u/OS 5.9), but not on Win2000.

Interesting to note that the exception is thrown when  tabbedPane.setTabPlacement(JTabbedPane.RIGHT);

and 

tabbedPane.setTabPlacement(JTabbedPane.BOTTOM);

only.

Comments
EVALUATION Name: drR10255 Date: 01/13/2004 This is a duplicate of 4962642. ======================================================================
24-08-2004