Question: A Java Swing application has a login page as shown in Figure 5. Users are required to enter the correct passcode to start the application.

A Java Swing application has a login page as shown in Figure 5. Users are required to enter the correct passcode to start the application. The system uses a scrambled keypad with a randomly allocated set of numbers from 0 to 9. The display shall show "Enter passcode" initially, and show an asterisk (*) for each number entered. Upon pressing the "Enter" button, the system verifies the passcode. If the passcode is correct, the system invokes a method called startApp) to start the application. Otherwise, it displays the message "Wrong passcode". The "Clear" button shall clear the display Assume that the following methods are available public String getPasscode ) // return the passcode public void startApp ) public void shuffleArray (int [] array) // Start the application // Shuffle (Randomize) the given int array, e.g., // int [] numbers1, 2, 3, 4, 5}; // shuffleArray (numbers); // Randomize the elements Write the codes for the login page. State your assumptions, if any (17 marks) Login CLEAR Enter Figure 5 A Java Swing application has a login page as shown in Figure 5. Users are required to enter the correct passcode to start the application. The system uses a scrambled keypad with a randomly allocated set of numbers from 0 to 9. The display shall show "Enter passcode" initially, and show an asterisk (*) for each number entered. Upon pressing the "Enter" button, the system verifies the passcode. If the passcode is correct, the system invokes a method called startApp) to start the application. Otherwise, it displays the message "Wrong passcode". The "Clear" button shall clear the display Assume that the following methods are available public String getPasscode ) // return the passcode public void startApp ) public void shuffleArray (int [] array) // Start the application // Shuffle (Randomize) the given int array, e.g., // int [] numbers1, 2, 3, 4, 5}; // shuffleArray (numbers); // Randomize the elements Write the codes for the login page. State your assumptions, if any (17 marks) Login CLEAR Enter Figure 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
