Question: An application shown below will help a user to create and show a grocery list. The first button Add to List of the allows the

 An application shown below will help a user to create andshow a grocery list. The first button \"Add to List\" of the

An application shown below will help a user to create and show a grocery list. The first button \"Add to List\" of the allows the user to add items to the grocery list, which is saved to a random access file. The second button "View ListII allows the user to View the list to the Text Area. The ra ndom-access file description is shown bellow: File: groceriesdat Description Type Size Item Name String 40 quantity int n/a Use anonymous classes to register the \"Add to ListII button and \"View List" button and create the event handler to handle click events on these buttons. A. Write the event handler method that handles the \"Add to List\" button. The add button adds a record to the groceries.dat file. After the record is added, clear the input fields and set the focus to the item name field. B. Write the event handler method that handles the \"View List" buttoni the user clicks the \"View List\" button to display the grocery list in the TextArea component. Write the event handler for this button that connects an input stream to the groceries.dat file, reads and displays all the records, and then closes the file stream. Notes 1.You are not required to code the user interface ( You should assume it is already provided). The names of the required components are prowded in the bellow figure. 2. You are only required to provide the code ofthe controller class. \f

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 Programming Questions!