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.
Create a java Swing program which allows the user to draw a polygon. You will need to implement the interfaces MouseList
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am