Question: Implement a class Polygon that contains an array list of Point2D.Double objects. Sup port methods: Draw the polygon by joining adjacent points with a line,
Implement a class Polygon that contains an array list of Point2D.Double objects. Sup port methods:
![]()
Draw the polygon by joining adjacent points with a line, and then closing it up by joining the end and start points. Write a graphical application that draws a square and a pentagon using two Polygon objects.
public void add (Point 2D.Double aPoint) public void draw (Graphics2D g2)
Step by Step Solution
3.44 Rating (163 Votes )
There are 3 Steps involved in it
To implement a Polygon class with the specified functionality you can use Javas AWT and Swing libraries for the graphical interface The Point2DDouble ... View full answer
Get step-by-step solutions from verified subject matter experts
