I am trying to basically use the methods as functions and then call them in main but I cant figure it out. I thought it could be done like this but maybe I am just confusing my php&mysql class with Java. At the bottom of my code, there is a comment with what exactly I was trying to accomplish. Sorry if I am not using proper terminology but I am not very familiar with java.
import javax.swing.JOptionPane;
public class DouglasPassword {
public String pword, pwordVerify;
public String validatePword(String pword)
{
pword = JOptionPane.showInputDialog(null, "Enter Password: ", "Create Password", JOptionPane.QUESTION_MESSAGE);
if (pword.length() > 5 && pword.length() < 11) {
for (int j = 0;j < pword.length();j++) {
if (Character.isDigit(pword.charAt(j))) {
}
}
JOptionPane.showMessageDialog(null, "Correct Password!", "Correct Password!", JOptionPane.INFORMATION_MESSAGE);
}
else
JOptionPane.showMessageDialog(null, "Incorrect Password! Please Try Again.", "Incorrect Password!", JOptionPane.ERROR_MESSAGE);
return pword;
}
public String verifyPword(String pword, String pwordVerify, Boolean pass){
pwordVerify = JOptionPane.showInputDialog(null, "Confirm Password: ", "Confirm Password", JOptionPane.QUESTION_MESSAGE);
if(pword.equals(pwordVerify)){
JOptionPane.showMessageDialog(null, "Correct Password!", "Correct Password!", JOptionPane.INFORMATION_MESSAGE);
}
else {
JOptionPane.showMessageDialog(null, "Incorrect Password! Please Try Again.", "Incorrect Password!", JOptionPane.ERROR_MESSAGE);
}
return pwordVerify;
}
public static void main(String[] args)
{
//I wanted to have the code here be something like while(x=false) execute validatePword until x=true
//Then do it verifyPword until y=true.
}
}