@SuppressWarnings("deprecation")
	@Override
	public void actionPerformed(ActionEvent e) {
		boolean isDigit=false;
		if(e.getSource()==jbtSubmit)
		{ 
			userName = jtfUserName.getText();
			passcode = new StringBuilder(jpwUserPassword.getText());
			if(userName.length()<5||userName.length()>5)
			{
				JOptionPane.showMessageDialog(null, "User Name Must be 5 letters in length");
			}
			for(int i=0;i<passcode.length();i++)
			{
				if(Character.isDigit(passcode.charAt(i)))
				{
					isDigit=true;
				}
				else
				{
					isDigit=false;
					break;
				}
			}
			if(passcode.length()<4||isDigit==false)
			{
				JOptionPane.showMessageDialog(null, "Password must be 4 numbers");
			}
			else
			{
				passcode1 = Integer.parseInt(passcode.toString());
				//checks if user name and password already exists
				if(doesUserExist())
					JOptionPane.showMessageDialog(null, "User Exists Please Change User Name");
				if(doesPasswordExist())
					JOptionPane.showMessageDialog(null, "Password Exists Please Change Password");
				if(doesUserExist()==false&&doesPasswordExist()==false)
				{
					userAndPasswordSaver saver = new userAndPasswordSaver(userName,passcode1);
					this.setVisible(false);
					this.dispose();
				}
			}
//			System.out.println(userName);
//			System.out.println(passcode);

		}
		else if(e.getSource()==jbtCancel)
		{
			this.setVisible(false);
			this.dispose();
		}
	}