src/presentation_layer/LoginView.java
@Override
	public void actionPerformed(ActionEvent e) {
		user = username.getText();
		pass = password.getText();

		switch (e.getActionCommand()) {

		case "Login":
			boolean status = false;
			if (pass.isEmpty()) {
				status = controller.validateOrdinaryUser(user);
				if (status)
					JOptionPane.showMessageDialog(null, "Ordinary user logged in succesfully");
				else
					JOptionPane.showMessageDialog(null, "Login Failed");
			} else {
				try {
					status = controller.validateRegisteredUser(user, pass);
				} catch (AddressException e1) {
					e1.printStackTrace();
				} catch (MessagingException e1) {
					e1.printStackTrace();
				}

				if (status)
					JOptionPane.showMessageDialog(null, "Registered user logged in succesfully");
				else
					JOptionPane.showMessageDialog(null, "Login Failed");
			}
			if (status)
				controller.changeVisibility("menu");

			break;
		}

	}
/*
	 * Action button for logging in.
	 */
Action button for logging in.
Action button for logging in .
@Override
	public void actionPerformed(ActionEvent e) {
		user = username.getText();
		pass = password.getText();
		switch (e.getActionCommand()) {
		case "Login":
			boolean status = false;
			if (pass.isEmpty()) {
				status = controller.validateOrdinaryUser(user);
				if (status)
					JOptionPane.showMessageDialog(null, "Ordinary user logged in succesfully");
				else
					JOptionPane.showMessageDialog(null, "Login Failed");
			} else {
				try {
					status = controller.validateRegisteredUser(user, pass);
				} catch (AddressException e1) {
					e1.printStackTrace();
				} catch (MessagingException e1) {
					e1.printStackTrace();
				}
				if (status)
					JOptionPane.showMessageDialog(null, "Registered user logged in succesfully");
				else
					JOptionPane.showMessageDialog(null, "Login Failed");
			}
			if (status)
				controller.changeVisibility("menu");
			break;
		}
	}
@ Override public void actionPerformed ( ActionEvent e ) { user = username . getText ( ) ; pass = password . getText ( ) ; switch ( e . getActionCommand ( ) ) { case "Login" : boolean status = false ; if ( pass . isEmpty ( ) ) { status = controller . validateOrdinaryUser ( user ) ; if ( status ) JOptionPane . showMessageDialog ( null , "Ordinary user logged in succesfully" ) ; else JOptionPane . showMessageDialog ( null , "Login Failed" ) ; } else { try { status = controller . validateRegisteredUser ( user , pass ) ; } catch ( AddressException e1 ) { e1 . printStackTrace ( ) ; } catch ( MessagingException e1 ) { e1 . printStackTrace ( ) ; } if ( status ) JOptionPane . showMessageDialog ( null , "Registered user logged in succesfully" ) ; else JOptionPane . showMessageDialog ( null , "Login Failed" ) ; } if ( status ) controller . changeVisibility ( "menu" ) ; break ; } }
Action button for logging in.
Action button for logging in .