I tried adding up a specific JTable cell value (in this case at (y,2)) with a value of another integer.
The idea is that you add up the initial value in the cell (which you convert to integer) with the value from JTextField (which you convert to integer)
int value = Integer.parseInt(table.getModel().getValueAt(y, 2)) + Integer.parseInt(materialsquantities[x].getText());
JTable could contain any type of objects (e.g.
Integers, etc), so
Object, not a
String. You should either cast result of
String (if the
JTable contains only
Strings) or explicitly convert
String, i.e. use
toString() method. In both cases you should remember about possible