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(ArrayList.java:546)
    at java.util.ArrayList.get(ArrayList.java:321)
    at bibliothek.extension.gui.dock.theme.eclipse.EclipseStackDockComponent.getDockable(EclipseStackDockComponent.java:208)
    at bibliothek.extension.gui.dock.theme.eclipse.EclipseFocusTraversalPolicy.list(EclipseFocusTraversalPolicy.java:57)
    at bibliothek.extension.gui.dock.theme.eclipse.EclipseFocusTraversalPolicy.getAfter(EclipseFocusTraversalPolicy.java:76)
    at bibliothek.gui.dock.focus.DockFocusTraversalPolicy.getComponentAfter(DockFocusTraversalPolicy.java:86)
    at bibliothek.gui.dock.focus.DockFocusTraversalPolicy.after(DockFocusTraversalPolicy.java:144)
    at bibliothek.gui.dock.focus.DockFocusTraversalPolicy.getComponentAfter(DockFocusTraversalPolicy.java:92)
    at javax.swing.SortingFocusTraversalPolicy.getComponentAfter(SortingFocusTraversalPolicy.java:230)
    at javax.swing.LayoutFocusTraversalPolicy.getComponentAfter(LayoutFocusTraversalPolicy.java:88)
    at java.awt.Component.nextFocusHelper(Component.java:6695)
    at java.awt.Container.nextFocusHelper(Container.java:3069)
    at java.awt.Component.doAutoTransfer(Component.java:6614)
    at java.awt.Component.autoTransferFocus(Component.java:6597)
    at java.awt.Component.hide(Component.java:1332)
    at java.awt.Component.show(Component.java:1302)
    at java.awt.Component.setVisible(Component.java:1253)
    at javax.swing.JComponent.setVisible(JComponent.java:2535)
    at java.awt.CardLayout.addLayoutComponent(CardLayout.java:203)
    at java.awt.CardLayout.addLayoutComponent(CardLayout.java:188)
    at java.awt.Container.addImpl(Container.java:1058)
    at java.awt.Container.add(Container.java:899)
    at bibliothek.extension.gui.dock.theme.eclipse.rex.RexTabbedComponent.insertTab(RexTabbedComponent.java:263)
    at bibliothek.extension.gui.dock.theme.eclipse.EclipseStackDockComponent.insertTab(EclipseStackDockComponent.java:202)
    at bibliothek.gui.dock.StackDockStation.add(StackDockStation.java:765)
    at bibliothek.gui.dock.StackDockStation.add(StackDockStation.java:724)
    at bibliothek.gui.dock.StackDockStation.move(StackDockStation.java:583)
    at bibliothek.gui.dock.control.DefaultDockRelocator.executePut(DefaultDockRelocator.java:143)
    at bibliothek.gui.dock.control.DefaultDockRelocator.dragMouseReleased(DefaultDockRelocator.java:536)
    at bibliothek.gui.dock.control.DefaultDockRelocator.dragMouseReleased(DefaultDockRelocator.java:467)
    at bibliothek.gui.dock.control.DefaultDockRelocator$MouseRepresentativeListener.mouseReleased(DefaultDockRelocator.java:728)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1778)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    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)

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!
thanks

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?

hi,

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?

thanks

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.

hi,

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.

hi,

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

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
raphi

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