Unknown ArrayIndexOutOfBoundsException

Hi,

I have a swing application with JTable running on JDK1.6.0.

It has been getting exceptions but I can't find the error source(file name and line number).

Can anybody help me how to solve this problem please.

Thank you in advance.

Exception in thread"AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 8 >= 6

at java.util.Vector.elementAt(Vector.java:427)

at javax.swing.table.DefaultTableColumnModel.getColumn(DefaultTableColumnModel.java:277)

at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1965)

at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1765)

at javax.swing.plaf.ComponentUI.update(ComponentUI.java:143)

at javax.swing.JComponent.paintComponent(JComponent.java:758)

at javax.swing.JComponent.paint(JComponent.java:1022)

at javax.swing.JComponent.paintChildren(JComponent.java:859)

at javax.swing.JComponent.paint(JComponent.java:1031)

at javax.swing.JViewport.paint(JViewport.java:747)

at javax.swing.JComponent.paintChildren(JComponent.java:859)

at javax.swing.JComponent.paint(JComponent.java:1031)

at javax.swing.JComponent.paintToOffscreen(JComponent.java:5104)

at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)

at javax.swing.RepaintManager.paint(RepaintManager.java:1132)

at javax.swing.JComponent._paintImmediately(JComponent.java:5052)

at javax.swing.JComponent.paintImmediately(JComponent.java:4862)

at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:727)

at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:683)

at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:663)

at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

[2555 byte] By [Gilotina] at [2007-11-27 6:17:52]
# 1

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 8 >= 6

at java.util.Vector.elementAt(Vector.java:427)

at javax.swing.table.DefaultTableColumnModel.getColumn(DefaultTableColumnModel.java:277)

your implementation of TableModel trying to access 9th element (9th=8 in zero base) in vector you keep cell value, which the size of vector is only has 6 elements.

j_shadinataa at 2007-7-12 17:31:14 > top of Java-index,Core,Core APIs...
# 2
I'd assume you are filling the JTable while concurrently showing it. You should somehow get it synchronized (which depends on what exactly your code does).
stefan.schulza at 2007-7-12 17:31:14 > top of Java-index,Core,Core APIs...