public String getColumnName(int col) { return st[col]; }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionclass LignesModel extends AbstractTableModel { private Vector[] vc; private String[] st; private int nbcol; public LignesModel(int nbc, String[] ch) { nbcol = nbc; st = new String[nbcol]; vc = new Vector[nbcol]; for (int i = 0; i < nbcol; ++i) { st[i] = ch[i]; vc[i] = new Vector(); } } public void effacerTout() { for (int i = 0; i < nbcol; ++i) vc[i].clear(); } public void ajouterLigne(String[] ch) { for (int i = 0; i < nbcol; ++i) vc[i].add(ch[i]); } public String[] getColonne(int index) { return (String[]) vc[index].toArray(new String[vc.size()]); } public int getColumnCount() { return nbcol; } public int getRowCount() { return vc[0].size(); } public String getColumnName(int col) { return st[col]; } public Object getValueAt(int parm1, int parm2) { return vc[parm2].get(parm1); } public boolean isCellEditable(int row, int col) { return true; } }