@Override
	public void mouseClicked(MouseEvent e) {
		String compntName = "";
		Tuple t = null;
		
		if (e.getSource().getClass().getName().indexOf("JButton") > -1) {
			compntName = ((JButton) e.getSource()).getLabel();
			char[] entered_pword;
			
			String username = "";
			
			//see what JButton was clicked on
			if (compntName.equalsIgnoreCase("register")) {
				//user clicked register
				//register();
				entered_pword = fldPassword.getPassword();
				fldPassword.setText("");
				username = fldUserName.getText();
				t = User.createAccount(username, entered_pword, cnxn);
				if (((Boolean) t.getTup1()) == false) {
					JOptionPane.showMessageDialog(strframe, (String) t.getTup2());
					
					//zero out the password after use
					entered_pword = Password.zeroOut(entered_pword);
				} else {
					int rtnId = User.signIn(username, entered_pword, cnxn);
					
					//zero out the password after use
					entered_pword = Password.zeroOut(entered_pword);
					currUser = new User(username, rtnId);
					//JOptionPane.showMessageDialog(strframe, "Registered + Signed in");
					String pathToKeys = JOptionPane.showInputDialog(strframe, "Registered + Signed in. Please enter a directory to save your application-specific keys. Example format: C:\\Users\\Sam\\Desktop\\keys");
					try {
						RSATools.generateRSAKeyPair(pathToKeys);
						JOptionPane.showMessageDialog(strframe, "public.key and private.key successfully created at " + pathToKeys + 
														" You may share your public key with your followers. Please keep your private key secure and use " +
														"it to encrypt your tweets and decrypt direct messages from other users.");
						
					} catch (GeneralSecurityException e1) {
						JOptionPane.showMessageDialog(strframe, e1.getMessage());
					} catch (IOException e1) {
						JOptionPane.showMessageDialog(strframe, e1.getMessage());
					}
					strframe.setTitle("SecTweet - " + username);
					
					//get users following this user 
					getFollowers();
					
					//get requested followers
					getFollowRequesters();				
					
					//get users this user is following
					getFollowing();
				}
			} else if (compntName.equalsIgnoreCase("Login")) {
				
				if (nSigninAttempts > NUM_SIGNIN_ATTEMPTS_PERMITTED) {
					JOptionPane.showMessageDialog(strframe, "Too many failed signin attempts. Please try again later");
					System.exit(0);
				}
				entered_pword = fldPassword.getPassword();
				//passwordField.setText("");
				username = fldUserName.getText();
				int rtnId = User.signIn(username, entered_pword, cnxn);
				
				//zero out the password array after use
				entered_pword = Password.zeroOut(entered_pword);
				
				fldPassword.setText("");
				
				if (rtnId > -1) {
					//signIn();
					currUser = new User(fldUserName.getText(), rtnId);
				
					//make sure the fail label is hidden if login was successful
					//accessMessageLbl.setText("Signed in");
					//accessMessageLbl.setVisible(true);
					JOptionPane.showMessageDialog(strframe, "Login successful");
					
					strframe.setTitle("SecTweet - " + username);
					
					//get users following this user 
					getFollowers();
					
					//get requested followers
					getFollowRequesters();				
					
					//get users this user is following
					getFollowing();
					
					//get this user's feed
					getFeed();
				} else {
					nSigninAttempts++;
					JOptionPane.showMessageDialog(strframe, DFLT_SIGNIN_ERROR_TEXT);
				}
				
			} else if (compntName.equalsIgnoreCase("Follow")) {
				if (currUser == null) {
					lblFollowMessage.setText("You must be signed in to follow users");
				} else {
					int rtnId = User.findUser(fldSearchForUser.getText(), cnxn);
					
					if (rtnId > -1) {
						Tuple rsltTuple = FollowTools.initializeFollow(currUser.getId(), rtnId, cnxn);
						lblFollowMessage.setText((String)rsltTuple.getTup2());
					} else {
						lblFollowMessage.setText("User not found");
					}
				}
				
				lblFollowMessage.setVisible(true);
			} else if (compntName.equalsIgnoreCase("Add Tweet")) {
				String tweetText = txtAreaTwet.getText();
				String privKeyText = txtAreaKeyPath.getText();
				
				//make sure we have our inputs 
				if (tweetText.length() > 140) {
					JOptionPane.showMessageDialog(strframe, "You may only tweet up to 140 characters");
				} else if (privKeyText.length() == 0){
					JOptionPane.showMessageDialog(strframe, "Please enter the path to your private key");
				} else {
					//add the tweet
					Key privKey;
					Tuple rslt = null;
					
					try {
						privKey = RSATools.loadRSAPrivateKey(txtAreaKeyPath.getText());
						byte[] encTweetText = RSATools.encrypt(RSATools.hexToBytes(tweetText), privKey);
						txtAreaTwet.setText(RSATools.bytesToHex(encTweetText));
						rslt = Tweet.addTweet(currUser.getId(), encTweetText, cnxn);
						refreshFeed();
					} catch (NoSuchAlgorithmException ex) {
						JOptionPane.showMessageDialog(strframe, ex.getMessage());
					} catch (InvalidKeySpecException ex) {
						JOptionPane.showMessageDialog(strframe, ex.getMessage());
					} catch (IOException ex) {
						JOptionPane.showMessageDialog(strframe, ex.getMessage());
					} catch (GeneralSecurityException ex) {
						JOptionPane.showMessageDialog(strframe, ex.getMessage());
					}
				}
				
				
			}
		}
		
	}