Question: Write a GUI application that displays a password based on user input into 2 TextFields. Note: We are updating the FahrenheitConverter.java code from Chapter 4.

Write a GUI application that displays a password based on user input into 2 TextFields.

Note: We are updating the FahrenheitConverter.java code from Chapter 4. Start by getting this code from the book to work first before making updates.

Your program will contain 2 classes: A) A class called PassWordCreator inside a file named PassWordCreator.java This class contains the main() method that creates and displays the 'window' for the program.This is the driver program.

B) A class called PassWordPane that instantiates 4 Labels and 2 TextFields. It also contains the 'handlers' that 'listen' and respond when a user types into the TextFields and presses . In Java FX these 'listeners' are method references. Hint: Each TextField needs its own 'listener'. As they are methods, you can name them what you want. The file is named PassWordPane.java

The password is displayed by the 4th Label and uses this algorithm (this is NOT the algorithm for the program as a whole): I first 2 letters of name II plus a period III plus a 1-2 digit positive random number IV plus last 4 digits of date

Note: The first label must display your own name(s).

IMPORTANT: Substitute this line in FahrenheitPane.java: fahrenheit.setPrefWidth(50); //this method does not work on TextFields with fahrenheit.setPrefColumnCount(5); //this is correct method for TextFields The display of the TextField will now be OK

2) To compile the program, type this (at system prompt): javac PassWordCreator.java Our application will be called PassWordCreator.class

3) To run the program, type this (at system prompt): java PassWordCreator Output will appear in a separate window 4) To see all the .class files that constitute the executable program: ls Pass*.class //on Mac or Linux dir Pass*.class //on Windows

Input

Input comes from the user entering a name into the first TextField (followed by ) and a 6-digit date into the second TextField (followed by ). Note: The getText() method returns a StringWrite a GUI application that displays a password based on user input

Instructions/Design Note: Only one algorithm needed. Place in comment at top of driver program file (PassWordCreator.java) 1) Write a GUI application that displays a password based on user input into 2 TextFields. Note: We are updating the FahrenheitConverter.java code from Chapter 4. Start by getting this code from the book to work first before making updates. Your program will contain 2 classes: A) A class called PassWordCreator inside a file named PassWordCreator.java This class contains the main() method that creates and displays the 'window' for the program.This is the driver program B) A class called PassWordPane that instantiates 4 Labels and 2 TextFields. It also contains the 'handlers' that 'listen' and respond when a user types into the TextFields and presses . In Java FX these 'listeners' are method references Hint: Each TextField needs its own 'listener'. As they are methods, you can name them what you want The file is named PassWordPane.java The password is displayed by the 4th Label and uses this algorithm (this is NOT the algorithm for the program as a whole) / first 2 letters of name /l plus a period III plus a 1-2 digit positive random number /V plus last 4 digits of date Note: The first label must display your own name(s)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!