Java Netbeans

  

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Implement the Swing application using the GUI you designed in the Phase 1 Discussion Board. The user will have to enter the following data items:

  1. Sales representative ID
  2. Sales representative First      Name
  3. Sales representative Last      Name
  4. Total sold for each of      three categories: office supplies, books, and paper
  5. Sales district (North,      South, East, West).
  6. Preferred means of contact      with potential buyers (phone, e-mail, visit)

Include a QUIT button to exit the application and an ENTER button that causes the sales representative’s data to be retrieved from the GUI components and submitted to the application. The sales representative’s data will echo to the jTextArea each time the ENTER button is pressed.

Expand your Swing application to write the entered data out to a text file. Instead of displaying the data in the jTextArea when ENTER is pressed, change this functionality so that the data is written to a file. Name the output file salesrep.txt. Each time the ENTER button is pressed, the data will be written to the file. Write the data in the following format to a text file, using white spaces as the delimiter. Include the categories (SUPPLIES, BOOKS, PAPER) in your file to label the dollar amount sold for each category. The sales district entered should be converted to upper case (NORTH, SOUTH, EAST, WEST). Independent line separators should be used in the output file. Code for the ENTER button should be well commented.

Expand your application to include an EVALUATE button. Each time the EVALUATE button is selected, the sales representative data will be read and the amounts sold in SUPPLIES, BOOKS, and PAPER will be totaled. If the amount sold on all three categories is greater than or equal to (>=) $8,000, write the sales representative data to a new file, stars.txt. These sales representatives will receive a bonus to demonstrate appreciation for a job well done. Your stars.txt file should not be opened for appending each time the application is run. Independent line separators should be used in the output file. The code should be well commented.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Enhance your application by creating a DISPLAY button. When this button is selected, the stars.txt file will be read in and displayed. Create a Sales Representative class that stores sales representative information. A Sales Representative object will be created for each sales representative that is read in when the DISPLAY button is selected. Select appropriate attributes for your sales representative. Ensure that you have created appropriate constructor(s) that will allow you to create sales representatives with the values read in from the file for sales rep ID, sales rep first name, sales rep last name, and so on.

With each sales representative that is read in from your stars.txt input file, you will create a Representative object that holds the sales representative data and add each Representative object to an ArrayList. Do not store your sales representative information as a String and add this String into your ArrayList. You must use your Representative class to create Representative objects. You should store Representative objects that encapsulate your sales representative information and store these in your ArrayList.

Hint: You may want to look into overriding the toString() method to provide a readable string representation of the Representative object.

After the ArrayList has been created, this ArrayList will be iterated over and displayed to the jTextArea. Override the toString() method for your Representative class so that each sales representative is printed in a readable manner. Total sales representatives should also be displayed.

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER