private void btnSaveMouseClicked(MouseEvent evt) 
	{
		System.out.println("btnSave.mouseClicked, event="+evt);
		//add/modify only after all validation passes
		if(validateFields())
		{
			Agent newAgent = new Agent();
			newAgent.setAgentId(agent.getAgentId());
			newAgent.setAgentFirstName(txtFirstName.getText());
			newAgent.setAgentMI(txtMI.getText());
			newAgent.setAgentLastName(txtLastName.getText());
			newAgent.setAgentPhone(txtPhone.getText());
			newAgent.setAgentEmail(txtEmail.getText());		
			newAgent.setAgentPosition(txtPosition.getText());
			newAgent.setAgencyId(cmbAgencyId.getSelectedItem().toString());
			if (addClicked)
			{
				agentDB.insertAgent(newAgent);//call DB class to insert new agent
				// Update the parent.
				parent.populateAgent(Integer.parseInt(agentDB.getMaxAgentId()));
			}
			else
			{
				agentDB.updateAgent(newAgent);//call DB class to update existing agent
				// Update the parent.
				parent.populateAgent(newAgent.getAgentId());
			}
					
			//dispose current dialog
			dispose();
		}

	}