In this assignment youll create an JavaFx application that allows the user to enter and sort a student database. Youll be creating a JavaFx GUI, and get some experience using abstract classes and interfaces.
Implement a class called Student to store student information. Your class should be based on the abstract class Person provided with this assignment. In addition to the inherited fields and methods, include the following fields/methods:
Youll be using your Student class in a list of students created by your GUI.
Create an JavaFx application which allows you to enter student information. Your GUI should have one activity with the following components:
The following image shows a possible GUI design, but this is just a fairly boring example, design your GUI in the way you think is best. see image.
You should use an ArrayList of Student objects to store your list of students. The Add button adds a new student to the end of the list, the sort button sorts your list of students by name, and the display button shows a simple popup dialog containing a list of all students information (student info provided by the toString method).
Create a second scene and set the modality as follows:
...
Stage secondStage = new Stage();
secondStage.initModality(Modality.APPLICATION_MODAL);
secondStage.setScene(scene);
...
To sort your list of students you can use the Collections.sort method from the Java library. For this to work you must implement the Comparable interface for the objects being sorted. A good place to put the Comparable interface implementation is in the Person class, since we are sorting by name (a field of the Person class). Update the class I provided.