I am a student who has been given the following assignment. Before I am reprimanded for posting asking for assistance without providing an attempt at code, please allow me to explain. We have been given the assignment shown below with no explanation. We have not covered any of the Swing related code or any method for creating windows, buttons, etc. All our lectures and assignments have been terminal or console based. Our course does not have a book, all information comes directly from the professor who claims programming books are worthless.

I am not looking for a posted solution, rather helpful nudges in the direction I need to be going since I have never been taught anything over the subject. I do have all the sort methods written though, so no assistance is required there. I just am looking for help with the window/buttons/authentication/mask aspect.

The assignment is as follows:

Design and create a window_form with two text boxes; one for userid and the other for password. The password entry must be masked. Write a code snippet to authenticate the user upon entering userid and password, then opening the next window. If either userid or password were to be incorrect appropriate message(s) should be displayed. There should be two buttons on each window_form with appropriate titles and buttons Next (or Back) and Exit. The second window_form should have additional buttons or a dropdown list or a menu to invoke Insertion_sort, Bubble_sort, Selection_sort, mege_sort and quick_sort respectively.

Thanks in advance for any and all help, you are all invaluable in the learning process through your supplementary instruction and explanation.

Edited by JavaNewbieEK: n/a

6 Years
Discussion Span
Last Post by stultuske

I have been able to create my two text fields and two buttons, but the JAR is defaulting to the wrong text. How do you change or set the first text field available when the program opens?


that might be because of the order in which you added the fields.
since you're working with login and password, you might want to use:
1 JTextField
1 JPasswordField
instead of two JTextFields

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.