Question: Task: 3: [10 marks] Displaying Polygons Write a program to displays several n-sided polygons. Create a subclass of JPanel, named N_sidedPolygon, that displays a pentagon,
![Task: 3: [10 marks] Displaying Polygons Write a program to displays](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/670fab8263a93_194670fab8255ae7.jpg)
Task: 3: [10 marks] Displaying Polygons Write a program to displays several n-sided polygons. Create a subclass of JPanel, named N_sidedPolygon, that displays a pentagon, hexagon, heptagon, and octagon, nonagon, and decagon. These objects are created from N sidedPolygon in a frame. The class contains a property named Num of Sides, which specifies the number of sides in the polygon (So, if n is 3, it paints a triangle, if n is 4, it paints a square, etc.) The polygon is centered at the center of the panel. The size of the polygon is related to the size of the panel as shown in the figure below. n X 0000 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
