Hallo Freunde,
ich habe eine JTable programmiert. Es läuft alles soweit. Bei der Tabellenanzeige kriege ich andauernd solche Fehlermeldung. In der Zeile 76 der TestTableModel die als Ursache des Problems erkannt wird stehlt
Ich bin für jeden Tipp dankbar
ich habe eine JTable programmiert. Es läuft alles soweit. Bei der Tabellenanzeige kriege ich andauernd solche Fehlermeldung. In der Zeile 76 der TestTableModel die als Ursache des Problems erkannt wird stehlt
Code:
// Gibt das Objekt aus der jeweiligen Zelle der Tabelle zurueck
public Object getValueAt(int zeileNr, int spalteNr)
{
Vector zeile = (Vector)daten.elementAt(zeileNr);
Object s = zeile.elementAt(spalteNr);
String st = s.toString();
if (st.equals("true"))
return Boolean.TRUE;
else if (st.equals("false"))
return Boolean.FALSE;
else return s;
// return zeile.elementAt(spalteNr);
}
Ich bin für jeden Tipp dankbar
Code:
java.lang.ArrayIndexOutOfBoundsException: 7 >= 2
at java.util.Vector.elementAt(Vector.java:427)
at Testverwaltung.TestTableModel.getValueAt(TestTableModel.java:76)
at javax.swing.JTable.getValueAt(JTable.java:1760)
at javax.swing.JTable.prepareRenderer(JTable.java:3686)
at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1149)
at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:1051)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
at javax.swing.JComponent.paintComponent(JComponent.java:541)
at javax.swing.JComponent.paint(JComponent.java:808)
at javax.swing.JComponent.paintChildren(JComponent.java:647)
at javax.swing.JComponent.paint(JComponent.java:817)
at javax.swing.JViewport.paint(JViewport.java:707)
at javax.swing.JComponent.paintChildren(JComponent.java:647)
at javax.swing.JComponent.paint(JComponent.java:817)
at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4771)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)
at javax.swing.JComponent._paintImmediately(JComponent.java:4668)
at javax.swing.JComponent.paintImmediately(JComponent.java:4477)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
java.util.NoSuchElementException: Vector Enumeration
at java.util.Vector$1.nextElement(Vector.java:303)
at javax.swing.plaf.basic.BasicTableHeaderUI.getPreferredSize(BasicTableHeaderUI.java:482)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1272)
at javax.swing.ViewportLayout.layoutContainer(ViewportLayout.java:120)
at java.awt.Container.layout(Container.java:1017)
at java.awt.Container.doLayout(Container.java:1007)
at java.awt.Container.validateTree(Container.java:1089)
at java.awt.Container.validateTree(Container.java:1096)
at java.awt.Container.validate(Container.java:1064)
at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:353)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:116)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)