Objectives: To practice event-driven programming using Java-based GUIs. To refresh your Java skills.

Description: Develop a Java program that creates a standalone GUI application (not an applet) that simulates an e-store which allows the user to add items (books) to a shopping cart and once all items are included, total all costs (including tax), produces an invoice, and appends a transaction log file.

Your program development must include the following steps:

  • Create a main GUI containing the following components:
    • An area that allows the user to input data into the application along with the descriptive text that describes each input area.
    • A total of six buttons as shown below with functionality as described below.
    • As illustrated below, the various buttons on the interface are only accessible at certain points during a users interaction with the e-store.
  • An input file named inventory.txt. This file contains the data that will be read by the application when the user makes a selection. A sample file is provided for you on the course website.
  • An output file named transactions.txt must be created that uniquely logs each user transaction with the e-store. The unique transaction id will be generated as a permutation of the date/time string.

Restrictions:

Your source file shall begin with comments containing the following information:

/* Name: < your name goes here>
Course: CNT 4714 – Fall 2015
Assignment title: Program 1 – Event-driven Programming
Date: Sunday September 13, 2015
*/

Input Specification: The file inventory.txt as described above (see example below as well).

Output Specification: Output is to appear in the specified components of the GUI and various message boxes that appear, plus the contents of the transactions.txt log file that will be generated.

Additional Information:

Shown below are example screen shots of the GUI to help illustrate how your application is to operate.

1. Screen shot of the contents of inventory.txt. See image.

2. Initial GUI: See image.

3. GUI after user specifies total number of items in the order and makes a selection for item #1. See image.

4. GUI after user has selected the first item and clicked the Process Item #1 button. See image.

5. When the user clicks on the Confirm Item #1 button, a confirmation information message appears on the screen. See image.

6. The main GUI after the user has confirmed the first item. See image.

7. The GUI after the user has entered the information for all the items and confirmed the last item. See image.

8. When the user clicks the View Order button, the following message box should appear. See image.

9. When the user clicks the Finish Order button, the invoice message should be generated and displayed. See image.

10. The transaction file after order shown above was finished. Note the unique transaction ids based on the date and time. See image.

11. The transaction file after several orders have been completed. Note the unique transaction ids based on the date and time for every separate transaction. See image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.