I am trying to access a value in a JTable I have created, and use it in a calculation (simple addition).
String orderSize = (tableModel.getValueAt(2,3)).toString();
// I've tried a few ways to create an integer variable, it is not working here
int orderSizeInt = orderSize.parseInt();
int orderSizeInt2 = orderSize.valueOf(tableModel.getValueAt(2,3));
On the use of parseInt(), I get the error "The method parseInt() is undefined for the type String", which I am confused about.
Additionally, on the second line, I get two more errors. One, "Cannot convert from string to int". The other is that the static method valueOf(Object) from the type String should be accessed in a static way.
I am really confused and would appreciate any help!