Computer Science Homework Solutions
Problem
#113424

Java DVD Inventory Program - need to modify GUI to include more buttons and store items in dat file

Version 3   Modify the inventory program to include and Add button, a Delete button, and a Modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock, and the price of each unit. An item added to the inventory should have an item number one more than the previous last item. I also need to Add a save button to the GUI that saves the inventory to a C:datainventory.dat file. I need to use exception handling to create the directory and file if necessary. And I need to Add a search button to the GUI that allows the user to search for an item in the inventory by product name (DVD name). If the product is found, the GUI should display an appropriate message such as Product Found, here it is. If the product is found, the GUI should display that products information in the GUI.

Attached file(s):
Attachments
Inventory version 3.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

Inventory version 3.doc
Inventory Program Version 3

• Modify the Inventory Program to include an Add button, a Delete
button, and a Modify button on the GUI. These buttons should allow the
user to perform the corresponding actions on the item name, the number
of units in stock, and the price of each unit. An item added to the
inventory should have an item number one more than the previous last
item.

• Add a Save button to the GUI that saves the inventory to a
C:\data\inventory.dat file.

• Use exception handling to create the directory and file if
necessary.

• Add a search button to the GUI that allows the user to search for an
item in the inventory by the product name. If the product is not found,
the GUI should display an appropriate message. If the product is found,
the GUI should display that product’s information in the GUI.

Please see example below.

When for the first time the program is run, the data is automatically
loaded with the array of data that is hard coded in the program. In this
example there are 4 items. The user has the option of loading the data
saved in the “inventory.dat” by clicking on “load file” (To save
the data in the “inventory.dat” file, click on “Save” before
exiting the program).

Notice that all the fields are not editable. In this example the same 4
items are stored in the array.

Click on “First” to display the first item. Notice that all the
fields are still not editable. They are for viewing only.

Click on “Add” to add an item. Notice that the Item ID, Name,
Rating, # in Stock and Price fields are editable to allow the user to
enter the data. Also the Add button is changed to “Click to Add!”
The Index shows 4, which is the next index (i.e. the array will have 5
items).

The user can enter the data to be added.

After entering the data, the user clicks on “click to Add!” to add.
The button is then changed back to “Add.”

Now the user wants to modify the item just entered. He clicks on
“Modify.” The button is changed to “Click to Modify!” and only
the allowed fields are editable as shown below.

After making the changes, click on “Click to Modify!” The button is
changed back to “Modify.”

Click on “First” to display the first item. Click on “Search” to
look for a name. The button is changed to ‘Go!” The name field is
editable.

The name is entered, and “GO!” is clicked.

The item is found.

Click on ‘Search” again for a different name.

The name is not found.

Click on “OK” returns to the display of the item that was there with
the Name field not to be editable.

Click on “Previous” to get the previous item (Index #3). Click on
“Delete” to delete the current item.

The item is deleted and the array has only 4 items. The last item is now
displayed.

Click on “Save” to save the data in a file “inventory.dat”.
Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$39.90)
Included in Download
  • Plain text response
  • Attached file(s):
    • 113424.zip
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Modify the Inventory Program in Java - Modify the Inventory Program to include an Add button, a Delete button, and a Modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, t ...
  • Exception Handling in Java - Exception Handling in Java is a very powerful capability. Exception Handling allows us to check input, verify if files exist, precent division by zero, prevent array out of bounds, and a whole host of ...
  • Catching Exception Using Class Exception - Java - Write a program that demonstrates how various exceptions are caught with catch (Exception exception) This time, define classes ExceptionA (which inherits from class Exception) and ExceptionB (wh ...
  • Java Programming - Exception Handlers - Write three separate simple exception handlers, one for dividing by zero, another for attempting to open a nonexistent file, and the last for an array out-of-bounds check.
  • Done in vb.net, just make this basic, cause i want to add some more features to it - The MiniCalc application was designed to perform basic math calculations: +, -, *, /. However, in its present form, this application needs some improvements. 1. Test all operators with the values ...
Browse