Question: Create a Swing based GUI application to manage details about doctors for XYZ hospital. Create a class Doctor with details like name, specialization, visiting day.

Create a Swing based GUI application to manage details about doctors for XYZ hospital. Create a class Doctor with details like name, specialization, visiting day. Create another class called HospitalManagement. In this class create an ArrayList to store the objects of Doctor class. Create methods to perform the following activities. - In the constructor of this class create 10 doctor objects (with hardcoded values) and store the objects in the array list. - Search doctor - This method should accept a day of a week(String) as a parameter and return array list of all the doctors visiting that day. If no doctors visiting that day, then it should throw a user defined exception No doctors available on the given day. - List doctor This method should return array list of all the doctors sorted by visiting day. In swing application, use appropriate components for accepting input and displaying the output. Use drop down list to accept visiting day input. Create three buttons namely Search Doctor and Display Doctors. Search Doctor Read visiting day from the drop down list component and pass this to search doctor method of HospitalManagement class. Get the array list as a result from the method, iterate it, and display the output in a text area. (Concatenate all doctors details as a string and display it). Display Doctors - Call the list doctor method of HopitalManagement class and get the array list from the method. Iterate the method and display the doctors details in a text area component.

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!