public void confirmEvent() {
		confirm.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				String phonePattern = "[0-9]{3}\\-[0-9]{3}\\-[0-9]{4}";
				
				String pwd1 = new String(pwd1Field.getPassword());
				String pwd2 = new String(pwd2Field.getPassword());
				String id = bIDField.getText();
				String name = nameField.getText();
				String phone = phoneField.getText();
				String loc = locField.getText();
				
				//System.out.println(pwd1 + "\n" + pwd2);
				if (pwd1.equals("") || pwd2.equals("") || id.equals("") || name.equals("") || phone.equals("") || loc.equals("")) {
					JOptionPane.showMessageDialog(null, "Please fill in all starred fields.", "Warning", JOptionPane.INFORMATION_MESSAGE);
				} else if (!pwd1.equals(pwd2)) {
					JOptionPane.showMessageDialog(null, "The second password doesn't match the first one.", "Warning", JOptionPane.INFORMATION_MESSAGE);
				} else if (!phone.matches(phonePattern)) {
					JOptionPane.showMessageDialog(null, "Phone number should be in the form of XXX-XXX-XXXX.", "Warning", JOptionPane.INFORMATION_MESSAGE);
				} else {
					Broker broker = new Broker(name, id, phone, loc);
					BrokerControl control = new BrokerControl();
					if (control.createNewBroker(broker, pwd1)) {
						JOptionPane.showMessageDialog(null, "New broker has been successfully created.", "Warning", JOptionPane.INFORMATION_MESSAGE);
						singleton.dispose();
					}
				}
			}
		});
	}