mardi 16 juillet 2019

How do I create a GUI that accepts certain number of characters for a password?

I was assigned an assignment where I have to create a NetBeans GUI that asks the user a username and a password. The password must be a minimum of 8 characters in length. If it is not 8 characters a message must go out to user to notify them that it is not an appropriate password. I wasn't given any instructions on how to go about creating this application and the instructor is not responding to my emails in time before the due date which is why I'm asking this on Stack Overflow. Please help me figure out how to code for this type of program.

I've tried addressing a for loop so that the entered password has something to be compared to. I was thinking of adding an if statement so that if it does not meet the requirements, the appropriate message would be sent out. The code below is what I have so far...

   String strUser=this.txtInput1.getText();
        String password=this.txtInput2.getText();

        for (int i = 0; i < password; i++){

Aucun commentaire:

Enregistrer un commentaire