Question: WRITE IN JAVA. Write an applet that displays a 4x4 grid(16 square). When the user clicks on square in the grid, the applet should draw

WRITE IN JAVA. Write an applet that displays a 4x4 grid(16 square). When the user clicks on square in the grid, the applet should draw a filled circle on it. If the square already has a circle, clicking on it should disappear.

All of this needs to be in one class.

Use the MouseListener

Also, write method mousePressed to update the user mouse clicks.

Use repaint method as well

ps, seen different answers on here, so please do not use previous answers.. old solutions do not work.

thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!