Index out of bounds for changing tab order with eclipse theme

hi, first of all thanks for your awsome framework!

i’m using ver. 1.0.7, CControl and CGrid like in the sample, very basic.

unfortunately, i’m expieriencing problems with window tabs and the eclipse theme.

when i drag a pane to another tabbed pane (at a specific tab position, i.e. the marker appears next to a tab) or change the tab order inside a pane by dragging, i get the following exception:

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
    at java.util.ArrayList.RangeCheck(
    at java.util.ArrayList.get(
    at bibliothek.extension.gui.dock.theme.eclipse.EclipseStackDockComponent.getDockable(
    at bibliothek.extension.gui.dock.theme.eclipse.EclipseFocusTraversalPolicy.list(
    at bibliothek.extension.gui.dock.theme.eclipse.EclipseFocusTraversalPolicy.getAfter(
    at bibliothek.gui.dock.focus.DockFocusTraversalPolicy.getComponentAfter(
    at bibliothek.gui.dock.focus.DockFocusTraversalPolicy.after(
    at bibliothek.gui.dock.focus.DockFocusTraversalPolicy.getComponentAfter(
    at javax.swing.SortingFocusTraversalPolicy.getComponentAfter(
    at javax.swing.LayoutFocusTraversalPolicy.getComponentAfter(
    at java.awt.Component.nextFocusHelper(
    at java.awt.Container.nextFocusHelper(
    at java.awt.Component.doAutoTransfer(
    at java.awt.Component.autoTransferFocus(
    at java.awt.Component.hide(
    at java.awt.Component.setVisible(
    at javax.swing.JComponent.setVisible(
    at java.awt.CardLayout.addLayoutComponent(
    at java.awt.CardLayout.addLayoutComponent(
    at java.awt.Container.addImpl(
    at java.awt.Container.add(
    at bibliothek.extension.gui.dock.theme.eclipse.rex.RexTabbedComponent.insertTab(
    at bibliothek.extension.gui.dock.theme.eclipse.EclipseStackDockComponent.insertTab(
    at bibliothek.gui.dock.StackDockStation.add(
    at bibliothek.gui.dock.StackDockStation.add(
    at bibliothek.gui.dock.StackDockStation.move(
    at bibliothek.gui.dock.control.DefaultDockRelocator.executePut(
    at bibliothek.gui.dock.control.DefaultDockRelocator.dragMouseReleased(
    at bibliothek.gui.dock.control.DefaultDockRelocator.dragMouseReleased(
    at bibliothek.gui.dock.control.DefaultDockRelocator$MouseRepresentativeListener.mouseReleased(
    at java.awt.AWTEventMulticaster.mouseReleased(
    at java.awt.AWTEventMulticaster.mouseReleased(
    at java.awt.Component.processMouseEvent(
    at javax.swing.JComponent.processMouseEvent(
    at java.awt.Component.processEvent(
    at java.awt.Container.processEvent(
    at java.awt.Component.dispatchEventImpl(
    at java.awt.Container.dispatchEventImpl(
    at java.awt.Component.dispatchEvent(
    at java.awt.LightweightDispatcher.retargetMouseEvent(
    at java.awt.LightweightDispatcher.processMouseEvent(
    at java.awt.LightweightDispatcher.dispatchEvent(
    at java.awt.Container.dispatchEventImpl(
    at java.awt.Window.dispatchEventImpl(
    at java.awt.Component.dispatchEvent(
    at java.awt.EventQueue.dispatchEvent(
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(
    at java.awt.EventDispatchThread.pumpEvents(
    at java.awt.EventDispatchThread.pumpEvents(

with the standard theme there are no problems. also with the small sample app from the official site there are no problems when using the eclipse theme.
so i tried to comment everything not needed in my project to see if i can find something which is causing the error, but i can’t find anything.

Any tips what could be causing the problem are very appreciated!

Ok, I’ll try to reproduce and repair the bug once I’m at home.

In the mean time, do you have any special settings? For example a special LookAndFeel or a custom FocusTraversalStrategy?


yes i’m using lookAndFeel from jgoodies, but i’ve already checked it - also without it the error remains.
Otherwise nothing special, everything like the samle, CControl, CGrid with some DefaultSingleCDockable with Panels and Panes.

so far it’s mysterious, i tried to made a small test app to reproduce the problem (which would be very helpful for you guys probably) but actually i can’t reproduce it.

i wonder what else could be interfering?


Hmpf, I did come home late and at top of that was not able to find out anything useful.

I’ll try again at the weekend.


i could’nt solve the problem yet, but at least i know now what’s causisng it and can reproduce it.
after i checked really everything there was only the java jre left.
the problem only appeared with my java jre 1.5.0_08.
with the current 1.5.0_17 and java 6 everything’s fine! so somewhere between java 5 update 8 and 17 there’s the needed change.
don’t know if the theme can be adapted to work with all java5 versions, otherwise my app will get new system requirements :slight_smile:

thanks for you effort and again a big praise for a good framework with excellent documentation and support, which is hard to find out there…

[QUOTE=raphi]after i checked really everything there was only the java jre left.
the problem only appeared with my java jre 1.5.0_08. [/QUOTE]

Well, thanks for your efforts finding the bug, I assume you spend a few hours on this one.

Only with one jre version? 'm curios what they changed. :wink: But once reproducable a solution is seldomly hard to find.


i checked the jre’s between update 08 and update 17.

it’s working with jre’s >= 1.5.0_12. (but at first sight i could’nt find the responsible bugfix in the changelog of update 12)

best regards

Seems there was a List that was not updated early enough. I’ll upload a repaired version.