Hi everyone,
I'm writing a program that reads numbers from a text file, stores them in a table, does calculations on the numbers and displays the result in a jTable.
The scanner reads the numbers as doubles and stores them in an ArrayList.
My tablemodel is very similar to the one in this link, but I use ArrayList instead of Vector.
My problem is that the getValueAt(int, int) method of my tablemodel returns an object and not a double, so I can't do calculations on the values. How can go back from object to double. I could cast the object to String and than parse the string to a double, but that feels like a terrible way to do it.
Any suggestions?