Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

TableSorter errors when adding new data  RSS feed

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 helper class with DefaultTableModel

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(
at com.shared.model.TableSorter.getValueAt(
at javax.swing.JTable.getValueAt(Unknown Source)
at javax.swing.JTable.prepareRenderer(Unknown Source)...

code problem I:

code problem II:

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!