// If a table cell is being edited, we should accept the current
// value and stop the editing before adding a new row.
if (cookieTable.isEditing()) {
TableCellEditor cellEditor = cookieTable.getCellEditor(cookieTable.getEditingRow(),
cookieTable.getEditingColumn());
cellEditor.stopCellEditing();
}
tableModel.addNewRow();
tableModel.fireTableDataChanged();