Question: A set of programs allows a user to create and print a grocery list. The first part of the program allows the user to add
A set of programs allows a user to create and print a grocery list. The first part
of the program allows the user to add items to the grocery list, which is saved to a
sequential file.
The second part allows the user to print the list to the screen.
Write the code to perform event handling for the following UIs:
In this program, the user enters the item name and the item quantity and then
clicks the ADD button. This adds the item to the end of the file.
a Write the statements that connect to the groceries.txt file.
b Write the event handler method that handles the ADD and EXIT buttons. The
add button adds a pipedelimited record to the groceries.txt file. After the record
is added, clear the input fields and set the focus to the item name field.
The exit button should confirm exit with the user and, if they say ok close the file
stream make sure it was created to begin with and exit the program.
c In this part of the program, the user clicks the Print 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.txt file, reads and displays all the
records in the format shown, and then closes the file stream.
i need answer in javafx not in swing
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
