addTab () error

Servoy Developer
Version R2 2.2rc9-build 327
Java version 1.4.2-50 (Mac OS X)

*** AND ***

Servoy Developer
Version R2 2.2rc8-build 326
Java version 1.4.2_08-b03 (Windows XP)

Following on from another thread regarding add/remove tabs:

Hiding tabs in a tabpanel - Classic Servoy - Servoy Community

I did some testing myself with addTab() function and had it returning the following error:

java.lang.ArrayIndexOutOfBoundsException: 4 >= 4

The number returned (4) is the tab position which was being added as the tabPanel object already had three tabs.

I have now verified that this same error is being returned on both of the above platforms and versions - rc9 on OSX and rc8 on WinXP

The method used was a simple single line method with the following code:

elements.tabs_70.addTab(forms.actions,‘actions’,null,null,‘#000000’,‘#BBCCEE’);

And it was driven from a button on the form containing the tabPanel object

The tab IS added using the above code but always returns the error !?

Can anyone else verify, please ?

Cheers
Harry[/quote]

Follow up from the original post here and the thread under ‘Forms’ forum.

The detail posted into the .log.txt file is as follows :

2005-06-09 11:39 : Looking for servoy.properties on /Users/harrycat/servoy.properties
2005-06-09 11:39 : Loading servoy.properties from /Applications/Servoy/servoy.properties
2005-06-09 11:39 : Loading - Done
2005-06-09 11:40 : Using RMI registry on port 1099
2005-06-09 11:41 : org.mozilla.javascript.JavaScriptException: java.lang.ArrayIndexOutOfBoundsException: 4 >= 4
at org.mozilla.javascript.JavaScriptException.wrapException(JavaScriptException.java:71)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:366)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1249)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2031)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.executeFunction(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel$b.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1819)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1872)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:247)
at java.awt.Component.processMouseEvent(Component.java:5166)
at java.awt.Component.processEvent(Component.java:4963)
at java.awt.Container.processEvent(Container.java:1613)
at java.awt.Component.dispatchEventImpl(Component.java:3681)
at java.awt.Container.dispatchEventImpl(Container.java:1671)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3527)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3242)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3172)
at java.awt.Container.dispatchEventImpl(Container.java:1657)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
java.lang.ArrayIndexOutOfBoundsException: 4 >= 4
at java.util.Vector.elementAt(Vector.java:431)
at javax.swing.JTabbedPane.setForegroundAt(JTabbedPane.java:1273)
at com.servoy.j2db.dataui.SpecialTabPanel.setForegroundAt(Unknown Source)
at com.servoy.j2db.dataui.SpecialTabPanel.js_addTab(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:332)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1249)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2031)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.k.a(Unknown Source)
at com.servoy.j2db.develop.debugger.k.executeFunction(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel.a(Unknown Source)
at com.servoy.j2db.FormPanel$b.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1819)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1872)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:247)
at java.awt.Component.processMouseEvent(Component.java:5166)
at java.awt.Component.processEvent(Component.java:4963)
at java.awt.Container.processEvent(Container.java:1613)
at java.awt.Component.dispatchEventImpl(Component.java:3681)
at java.awt.Container.dispatchEventImpl(Container.java:1671)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3527)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3242)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3172)
at java.awt.Container.dispatchEventImpl(Container.java:1657)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

Hope that this sheds some light

Cheers
Harry[/quote]

thx fixed for the final
It failed when you set a color on the tab directly with addTab