PasswordUtility
For this lab I am providing the password generator logic as a Java Archive File. Instructions below show how to load a JAR file into Eclipse so that you can use it with your own GUI code.
Before beginning, you'll need to download the following two files (right-click, then Save As...):
- PasswordTester.java (an updated tester file to illustrate the use of the PasswordGenerator class)
- PasswordGenerator.jar (a Java ARchive file -- JAR -- containing the executable code for PasswordGenerator)
Once you've downloaded the above files, proceed as follows:
- Open Eclipse and create a new Java Project

- Find the PasswordTester.java file that you downloaded above in Windows Explorer (or Mac Finder) and drag it into the src folder of the project you created.

- The file will appear inside of the default package; however it will be marked with a red X, indicating that there are references in the file to user-defined classes that are not part of this project.

- In order to load the necessary file, select the project in the Eclipse explorer and then click Project:: Properties

- Select "Java Build Path" along the left, then the "Libraries" tab.

- Click "Add External JARs..."

- Find the jar file you've downloaded, then click "Open"

- PasswordGenerator.jar should now appear in the window section titled "JARs and class folders on the build path"

- Click OK to return to the Eclipse main window; the red X by PasswordTester.java should be gone, since it now recognizes the necessary files you've imported. At this point you can open PasswordTester.java and run it; then modify or use it as needed.

