Due: 2:10pm, Friday, November 6. Submit to Sauron.
Using Swing, build an application that allows the user to add circles, squares, and triangles to the screen. Users should be able to select their desired shape and then click a location in the window where the new shape is to appear.
The program you write should have the following behavior when executed.
There should be three buttons at the bottom of the window that represent each possible shape. The button of the current selection should be disabled, which can be accomplished using the setEnabled method of the JButton class. The circle button should be the initial selection when the program starts.
The user can click anywhere in the window to add the selected shape. The location the user clicks should be the center of the displayed shape. Each shape should have a different color.
If shapes overlap, the most recently added shape should be on top. This can be accomplished by drawing shapes in the order in which they are added.
The file ClickComponent.java contains a custom component that should be modified to achieve the goals of this assignment.