Question 2: Your task is to create a GUI application that allows a user to create a group of Hero o
bjects. Your group may be a small band of two or three Heroes or it may consist of thousands (t
hink Lord of the Rings or the Marvel Cinematic Universe here).
You have been given the compiled version of the class encapsulating a Hero and you have also be
en given the specification. Your job is to create a GUI application that allows the user to create
an ArrayList of Hero objects. Your GUI should allow the following operations on your Hero list:
1. Add Hero objects to the list – your list should start out with zero Heroes.
2.You should be able to add Hero objects by reading in from a text file or by adding them individ
ually through the GUI.
3.Delete Hero objects from the list – you can delete by index number, by hero name or both
4.Determine the Hero object with the highest energy level (i.e., the healthiest)
Cast a spell of “ heal all” that adds a random number of energy points (say between 1 and 50)
to all living Heroes.
5.Remove all perished (i.e., non‐ living) Heroes from the list
6.Determine the total and average energy points of the entire group of Heroes
7.Determine if a particular Hero is in the list – search by name
Write the current Hero list out to a new file
Challenge!:
1.Display the number of Heroes currently in the list – also displaying the number alive and the
number that are not alive.
2.Allow you to traverse the list – forwards and backwards – and allowed you to modify the He
roes as they came up in the GUI.
A file of Hero object data is included in the Eclipse package.
**Note: This question is in a package named “ default package” . Do not rename it.