java.lang.ArrayIndexOutOfBoundsException: -1
843804Nov 4 2004 — edited Nov 4 2004I've got 6 columns and dynamically populate the table cells from a file. That worked fine.
Now I implemented
<code>
.. extends JPanel implements TableModelListener {
...
table.getModel().addTableModelListener(this);
..
}
public void tableChanged(TableModelEvent e) {
..
}
// since I do not know the size prior loading the data I insert new row with each record
inRow.insertRow(newRow,new Object[]{""});
</code>
and the line ?table.getModel().addTableModelListener(this);? gives me this error:
?java.lang.ArrayIndexOutOfBoundsException: -1?. If I remove the line it works fine again.
If I would not get the error before implementing the Listener what then does have the Listener to do with Array_Indexing?