Question: Assignment For this assignment, we will convert the text-based Controller2 application from the previous assignment to a GUI application. The class name should be Controller3,

Assignment

For this assignment, we will convert the text-based Controller2 application from the previous assignment to a GUI application. The class name should be Controller3, an underscore, and your NetID run together; for example, if your NetID is abcde6, your class name would be Controller3_abcde6. Likewise, Employee2 should be renamed Employee3. The new design requirements are:

1) Contoller3 should extend JFrame and implement the ActionListener interface. Each Controller3 object should have, in addition to the prior data members:

a) One JPanel, added directly to the Controller3 object, and containing the JPanels in 1b) and 1c)

b) One one JPanel, a set of JButtons, one for each of the functions in the previous assignment: add, delete, update employee, update field, read, and exit with appropriate labels

c) On a second JPanel:

i) a JTextField object for user input. The JTextField should be cleared (use setText("") to clear it) whenever a new input is needed

ii) a JTextArea object for output. The JTextArea should be cleared (again, use setText("")) whenever a new command is processed (i.e., a JButton is pressed). Otherwise, successive lines of text should use its append method.

2) The GUI should respond to clicked JButtons as if the user had entered the same text command in the previous assignment. For example, if the user presses the Delete JButton, the program should display a prompt asking the index to delete in the output JTextArea, which the user enters in the input JTextField, triggering the deletion process.

Additional Constraints

As before, the program should be implemented as a single file containing the two Java classes Controller3 and Employee3. All data members should be declared as private; all methods should be declared without any visibility modifiers. It is not necessary to provide error-checking for this application; you may safely assume that the user will only enter valid inputs. However, please carefully follow the formats given; points will be deducted for non-standard input formats.

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