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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply