posted 21 years ago
Hello,
I'm retrieving data from a database, that i display in a jtable (the columns are id, name, age)using AbstractTableModel with an ArrayList .That's working fine.
My problem is that i want to select one row and put it in a class and i do it like that:
1/MyTableModel tm = (MyTableModel)getScrollPaneTable().getModel();
2/Person aPerson = (Person)tm.getElements().get(aRow);
The class Person contains 3 fields (id,name,age)
The method getElements returns the ArrayList that is used to displays rows in the table.
I have a ClassCastException on the second line and i don't khow how to deal with it.
Can anybody help me?
Thanks
Tina Sow