package com.samovich.cop2800.chapter7.assignment;

import javax.swing.JOptionPane;

/**
 * Filename PasswordInput.java
 * Created by Valery Samovich
 * Written on 6/17/2016
 */
public class PasswordInput {

    /**
     * Main method
     * @param args
     */
    public static void main(String[] args) {
        // declare fields
        String password;
        // prompt a user to type password
        password = JOptionPane.showInputDialog(
                null,
                "Please enter your password",
                "Password",
                JOptionPane.QUESTION_MESSAGE);
        // validate the password
        if (PasswordChecker.checkPassword(password)) {
            // display valid message
            JOptionPane.showMessageDialog(
                    null,
                    "Password is valid!",
                    "Password Check Result",
                    JOptionPane.INFORMATION_MESSAGE);
        } else {
            // display error message
            JOptionPane.showMessageDialog(
                    null,
                    "Password is invalid!\n" +
                            "Password must contain \n" +
                            "a uppercase letter, a lowercase letter,\n" +
                            "a number, a special character,\n" +
                            "and be 8 characters or longer with no spaces",
                    "Password Check Result",
                    JOptionPane.ERROR_MESSAGE);
        }
    }
}

@@ -1143,43 +1143,8 @@
 ain 
-%5Cn%22 +%0A                            %22
 a up
@@ -1163,27 +1163,8 @@
 er, 
-a lowercase letter,
 %5Cn%22 
@@ -1196,16 +1196,36 @@
      %22a 
+lowercase letter, a 
 number, 
@@ -1323,16 +1323,17 @@
 o spaces
+.
 %22,%0A     

Update error message