1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
private Vector maLigne = null;
private void Ajouter() {
if (table.isEditing())
if (table.getCellEditor() != null)
table.getCellEditor().stopCellEditing();
maLigne = ajout_ligne_vide();
model.insertRow(table.getRowCount(), maLigne);
table.editCellAt(table.getRowCount() - 1, 0);
table.getEditorComponent().requestFocus();
}
private Vector getLigneVide(){
return maLigne;
}
private Vector ajout_ligne_vide() {
Vector vide = new Vector();
for (int i = 0; i < table.getColumnCount(); i++)
vide.add("");
return vide;
} |
Partager