I’m having a problem when passing the information from a table to a bidimensional Array
for (int i=0; i < DefaultTableModel.getRowCount(); i++) {
for (int j=0; j < DefaultTableModel.getColumnCount(); j++) {
dataConteo[i][j]=DefaultTableModel.getValueAt(i,j);
}
}
I completely fill the table and still im getting an error in
dataConteo[i][j]=DefaultTableModel.getValueAt(i,j);
with NullPointerException.
Assuming
modelisn’tnull….Before the
forloop, did you allocate thedataConteoarray? ReplaceTypewith the actual type.