Create a class called BrainLobeGUI. This class should extend JComponent. Create a class called Lobe. Create a
Question:
Create a class called BrainLobeGUI. This class should extend JComponent. Create a class called Lobe.
Create a class called MainLobeGUI. This class should contain a main method.
You may add any number of variables, methods or other classes you find helpful.
Add private variables to the Lobe class the contain information defining one of the lobes. The required information is the name, the colour, the coordinates, the width and the height. Override the toString method to print the name of the lobe.
Add a private variable of type List to BrainLobeGUI. This variable should contain all the lobes that will be visualised.
Add a public method called addLobes that returns void and has no parameters. In this method create a lobe variable for Frontal Left, Frontal Right, Parietal Left, Parietal Right, Occipital Left and Occipital Right. When choosing the coordinates assume you are viewing the brain from above.
Add a paintComponent method and visualise all the lobes you created in addLobes. Add a BrainLobeGUI object to a JFrame and display it using the main method in MainLobeGUI. .
Add a MouseListener to BrainLobeGUI. Whenever the left mouse button is clicked print the name of the lobe that was clicked (if over a lobe) or nothing (if not over a lobe).