Menu

[Solved]-Question 2 Write Java Application Following Mvc Design Model Application Consist Four Clas Q37231612

Question 2: Write java application following the MVC design model. The application should consist of four classes: GUI, ContrQuestion 2: Write java application following the MVC design model. The application should consist of four classes: GUI, Controller, Student, and the main. The code of class Student it given below while you should write the code for the remaining classes. GUI class: use any layout manager to generate the above GUI interface. Controller: The controller class has an ArrayList of three students (Ahmed, ID: 123), (Salma, ID: 456), (Hamad, ID:789). The combo box should be initialized with the names of the three students inside the constructor of the controller class. The controller should listen to all of the four buttons in the GUI interface. o Add: When the user clicks on the Add button, the application should search for the user in the vector, and once it is found, it adds the course to the student by calling the method addCourse in class Student. The application also shows in the text area a confirmation message indicating that the course was added. Drop: When the user clicks on the Drop button, the application should search for the user in the vector, and once it is found, it drops the course by calling the method dropCourse in class student. The application also shows in the text area the status message returned from the method dropCourse to indicate whether the course successfully dropped or not o o Clear: When the user clicks on the Clear button, the application should clear the text field and the text area. o Show Details: When the user clicks on the button Show Details, the application should show in the text area the details of the student by calling the method toString of the class Student. Main: As usual, the main class: (1) creates an object of class GUI, (2) it creates an object from the Controller class with the GUI object sent as a parameter, (3) it registers the controller object as an action listener to all buttons declared in the GUI class. Show transcribed image text Question 2: Write java application following the MVC design model. The application should consist of four classes: GUI, Controller, Student, and the main. The code of class Student it given below while you should write the code for the remaining classes. GUI class: use any layout manager to generate the above GUI interface. Controller: The controller class has an ArrayList of three students (Ahmed, ID: 123), (Salma, ID: 456), (Hamad, ID:789). The combo box should be initialized with the names of the three students inside the constructor of the controller class. The controller should listen to all of the four buttons in the GUI interface. o Add: When the user clicks on the Add button, the application should search for the user in the vector, and once it is found, it adds the course to the student by calling the method addCourse in class Student. The application also shows in the text area a confirmation message indicating that the course was added. Drop: When the user clicks on the Drop button, the application should search for the user in the vector, and once it is found, it drops the course by calling the method dropCourse in class student. The application also shows in the text area the status message returned from the method dropCourse to indicate whether the course successfully dropped or not o o Clear: When the user clicks on the Clear button, the application should clear the text field and the text area. o Show Details: When the user clicks on the button Show Details, the application should show in the text area the details of the student by calling the method toString of the class Student. Main: As usual, the main class: (1) creates an object of class GUI, (2) it creates an object from the Controller class with the GUI object sent as a parameter, (3) it registers the controller object as an action listener to all buttons declared in the GUI class.

Expert Answer


Answer to Question 2: Write java application following the MVC design model. The application should consist of four classes: GUI, … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *