Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.ArrayIndexOutOfBoundsException: -1

843804Nov 4 2004 — edited Nov 4 2004
I'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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2004
Added on Nov 4 2004
2 comments
276 views