Question: Create a class GFrame that extends JFrame, implements ActionListener, and displays a user-determined filled polygon by selecting menu options. GFrame will also use a class

Create a class GFrame that extends JFrame, implements ActionListener, and displays a user-determined filled polygon by selecting menu options. GFrame will also use a class GPanel that extends JPanel on which the polygons are drawn and should be included in the same file as GFrame. The GFrame class should: Have a single GPanel on its content pane Have a menu bar with two menu options "Shape" and "Color". The shape options should be "Square" and "Circle" and the color options should be "Red" and "Green". When the application is first launched, the frame window should be visible but no shape should be displayed. When menu items are selected, the appropriate shape (filled with the appropriate color) will be displayed on the GPanel. You may find it useful to include boolean attributes like isSquare, isCircle, isRed, and isGreen to help the paintComponent method determine which shape & color are drawn. Until the user has selected both a shape and color, no shape should be displayed.

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 General Management Questions!