I'm trying to create row and column totals in a jTable. The user can input cell values using 3 text fields (to identify the row, column & value) and a button to add it to the table. The user should then be able to click on a second button which will sum all columns and rows and display the column sums in the last row and the row sums in the last column. Unfortunately I receive an error "NullPointerException" and the program breaks at line 135: salesTotal[row] += Double.valueOf(value).doubleValue();
I am under the impression that the cell values are objects and must be converted to (first) Strings and (second) doubles before you can total them, but not sure how to do this. The program breaks before it can set the value in the appropriate cell, so I haven't been able to test that part yet.