Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

P 11.26 Write a program with a graphical interface that implements a login windo

ID: 3551657 • Letter: P

Question

P 11.26 Write a program with a graphical interface that implements a login window with text fields for the user name and password. When the login is successful, hide the login window and open a new window with a welcome message. Follow these rules for validating the password:

1. The user name is not case sensitive.
2. The password is case sensitive.
3. The user has three opportunities to enter valid credentials.

Otherwise, display an error message and terminate the program. When the program starts, read the file users.txt. Each line in that file contains a username and password, separated by a space. You should make a users.txt file for testing your program.

P 11.27 InExerciseP11.26,the password is shown as it is typed. Browse the Swing documentation to find an appropriate component for entering a password. Improve the solution of Exercise P11.26 by using this component instead of a text field. Each time the user types a letter, show a ?? character.


I only need the answer for P 11.27.

thanks!

Explanation / Answer

Similar to JTextField there is JPasswordField in swing :)