Question: You are asked to create a small database for a Cricket team, make an ArrayList that contains information of players (in other words, each element

 You are asked to create a small database for a Cricket

team, make an ArrayList that contains information of players (in other words,

You are asked to create a small database for a Cricket team, make an ArrayList that contains information of players (in other words, each element within the list is a CricketPlayer object), and have this information accessible/editable through a GUI (Graphical User Interface). For this, you will design a CricketPlayer class and a GUI class used to implement the methods and interact with the user. CricketPlayer Class Write a CricketPlayer Class. This class should contain the player's name, player's jersey number and salary (in INR). These fields should be accepted as arguments in the constructor. The CricketPlayer class should include a getName, a getNumber and a getSalary method which return the name, the number, and the salary of the player, respectively. You should implement two more methods of your choice. For example, a setFieldingPosition method. GUI Class Write a GUI Class. This class should keep track of the players that are on the roster. It should also have an addPlayer method which adds a player to the roster. It should also have a removePlayer method which is given a player name and delete this player from the roster. Your GUI should have an "Add Player" button, a "Remove Player" button and a "Show Roster" button. These buttons should be found in one pane whereas the other pane can be used to show output. GUI Class Write a GUI Class. This class should keep track of the players that are on the roster. It should also have an addPlayer method which adds a player to the roster. It should also have a removePlayer method which is given a player name and deletes this player from the roster. Your GUI should have an "Add Player" button, a "Remove Player" button and a "Show Roster" button. These buttons should be found in one pane whereas the other pane can be used to show output. When the "Add Player" button is clicked, the program should pop up a window to ask the user for a player name, player jersey number, player salary, and any other information about the player. These shall be used to instantiate this player and add him to the roster. When the "Remove Player" button is clicked, the program should ask the user for a player name, go through the roster and eliminate the requested player. When the "Show Roster" button is clicked, the program should display the roster on a Table View. This means that the player, jersey number, salary and any other information should be displayed. Important: Your code should be properly formatted and commented. Put a brief comment on the top of each method clarifying its functionality. It will help anyone understand what you are trying to achieve using the method

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!