public int getRowCount() { try { return dao.findAll().size(); } catch (SQLException e) { e.printStackTrace(); } return 0; }
public Object getValueAt(int row, int col) { // Sí, es altamente ineficiente, pero lo estoy haciendo para practicar... List<Cuenta> list; try { list = dao.findAll(); } catch (SQLException e) { e.printStackTrace(); list = new ArrayList<Cuenta>(); } if (row >= list.size() || col >= headers.length) return null; Cuenta cuenta = list.get(row); switch (col) { case 0: return cuenta.getCodigo(); case 1: return cuenta.getCliente(); case 2: return cuenta.getEmail(); case 3: return cuenta.getSaldo(); } return null; }