Page 1 of 1

Create a java Swing program which allows the user to draw a polygon. You will need to implement the interfaces MouseList

Posted: Fri May 20, 2022 12:58 pm
by answerhappygod
Create a java Swing program which allows the user to draw a
polygon. You will need to implement the interfaces MouseListener
and ActionListener.
A frame or panel should display two buttons: "Draw Polygon" and
"Clear"
The user should be able to click any number of points on the
window and then "Draw Polygon". The GUI should draw a polygon based
on the coordinates of where the user clicked.
The user should be able to click "Clear" and the polygon is no
longer displayed. The user should then be able to draw a new
polygon.