I want to make a table model which stores entities via a list. Like this;
List list = new ArrayList<Entity>();
list.add(entity);
tableModel.setEntityVector(list);
in the Entity Table Model which extends AbstractTableModel the method getValueAt(int row, int column) should return the value of entity fields according to the row and column values. row represent entity number in the list and the column represent the field number in the entity object. But the problem is that when i use the following code;
Entity entity = list.get(rowCount - 1);
Field[] fields = entity.getClass().getDeclaredFields();
i cant reach fields of the object becouse entity fields must be private. And if i had used getDeclaredMethods() instead of getDeclaredFields() method then i could not reached the method that i want, using column parameter becouse of there are constructors, setters...
My question is that; how can i reach an entity's field values using column parameter of getValueAt(int row, int column) method of AbstractTableModel