I'm probably over looking something simple here but I am having problems with the method getValueAt() in the TableModel class. The problem is that it returns Objects and I want to add up the sum of primitive data types,int. Not sure how to approach this any help would be appreciated.
If those objects happen to store ints, then you can get the ints out and add them up. If the objects you put in don't store ints, then there are no ints there to add anyway.
For instance, if you put in Integer objects (possibly without knowing it by passing an int primitive to something that autoboxes(⇐click) it for you), then you can call Integer's intValue() method to get the int out, or just let auto-unboxing do it for you.
If you put in some other object that stores an int, then you'll have to get that int out by whatever means that object provides. For instance maybe it's a Person with a height, that has a getHeight() method.
If the method return Object and does not use generics(⇐click), then you'll have to cast. For example: