public void deletePerson(Person person, ArrayList<Person> list) {

		int answer = JOptionPane.showConfirmDialog(null, "Do you really want to delete "
				+ person.getName() + "?", " CONFIRMATION ", JOptionPane.YES_NO_OPTION);// displaying
																						// JOptionPane.YES_NO_OPTION
																						// Confirmdialog
																						// box
		if (answer == JOptionPane.YES_OPTION) {
			driver.getPersonDB().deletePersonFromList(person);
		}
		if (list.size() > 0) {
			setTextField(0, list);
		}
		else {
			setTextField(list.size() - 1, list);
			clearTextFields(list);
			deletePersonButton.setEnabled(false);
			editPersonButton.setEnabled(false);
			submitButton.setVisible(false);
		}
		revalidate();
		repaint();
	}