@Override
	public void actionPerformed(ActionEvent e) {
	
		// If user clicks login button, then log the user in.
		if (e.getSource() == loginView.loginButton) {
			handleLogin();
		}
		
		else if(e.getSource() == addUser.addButton){
			User user = new User();			
			user.Insert(addUser.getModel());
		}

		// If user clicks cancel button, dispose the frame.
		else if (e.getSource() == loginView.cancelButton) {
			loginView.dispose();
		}
		
		else if(e.getSource() == editUser.editButton){
			User user = new User();
			user = editUser.getModel();
			user.Update(user, id);
			
			JOptionPane
			.showMessageDialog(
					null,
					"Gebruiker is succesvol aangepast.",
					"Succes!", JOptionPane.QUESTION_MESSAGE);
			editUser.dispose();
		}
		
		else if(e.getSource() == editUserItem){
			showEditUser(id);
		}
		
		else if(e.getSource() == deleteUserItem){
			showDeleteUser();
		}
	}