1) EmployeeTable will have an array named e . Initially, the array will be created with size zero. Whenever a new EmployeeRecord object is created, the size of the array will be incremented and the...


1) EmployeeTable will have an array named
e. Initially, the array will be created with size zero. Whenever a new EmployeeRecord object is created, the size of the array will be incremented and the new EmployeeRecord object will be added to the array at the newly-available index. Likewise, if an EmployeeRecord is deleted, that index will be deleted from the array and the array size must be decremented by one.


2) DBApp3: This class replaces DBApp2 and will be a subclass of JFrame. DBApp3 will have an EmployeeTable
et, a constructor that creates
et, and a
main
method that creates a new DBApp2 object. The DBApp3 object will have GUI components to do the following:


a. Display individual records, with one EmployeeRecord field in a separate JTextField. When the application starts, all the JTextFields will be blank.


b. Add an EmployeeRecord to the array by entering valid data in the JTextFields and then creating the new EmployeeRecord object using the data by clicking on a "create" JButton. If any of the fields are invalid – using the criteria from the previous assignment – the new EmployeeRecord will not be created and any JTextFields holding invalid data will have a red background color.


c. Delete the currently-displayed EmployeeRecord from the array when the user clicks on a "delete" JButton. When an EmployeeRecord is deleted, the next higher index should be displayed. If no higher index exists, the next lower index should be displayed. If no lower index exists either, the JTextFields should be blank.


d. Scan sequentially through the EmployeeRecord array using a pair of JButtons to display the next or previous EmployeeRecords. Clicking the "next" JButton will display the fields of the next EmployeeRecord –
i.e., with the index one higher than the one currently shown. Likewise, clicking the "previous" JButton will display the fields of the one with the index one less than the one currently shown. Clicking "next" on the last EmployeeRecord or "previous" on the first EmployeeRecord will have no effect – the record shown will not change.


e. Change one or more fields of an existing EmployeeRecord by editing the text displayed in the JTextField(s) and clicking an "update" JButton. Again, any invalid updates will not be processed and any JTextFields holding invalid data will have a red background color.


f. Whenever a valid user command is processed, remember to restore any red backgrounds to their correct original color.


g. You will need a variable to keep track of the EmployeeRecord currently being shown. You might use -1 for the case where no record exists to be shown.


Aug 02, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here