• Post Reply Bookmark Topic Watch Topic
  • New Topic

TableSorter errors when adding new data

Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nobr]so here is the deal:

I am using the TableSorter.java helper class with DefaultTableModel
from: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

It works great when the data is static and I get it for the first time. however, occationally, when adding new data I get a NullPointerException error.

in use:
DefaultTableModel.removeRow() and
DefaultTableModel.insertRow() methods.

java.lang.ArrayIndexOutOfBoundsException: 5
at com.shared.model.TableSorter.modelIndex(TableSorter.java:294)
at com.shared.model.TableSorter.getValueAt(TableSorter.java:340)
at javax.swing.JTable.getValueAt(Unknown Source)
at javax.swing.JTable.prepareRenderer(Unknown Source)...

code problem I:

code problem II:

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!