For this lab, you’ll build on the Dots.java and DotsPanel.javaprograms.
Instead of drawing dots you will draw squares so add thatchange.
Add animation using a Timer so that the squares all move whendrawn. Make each square move at random speed (in x and ydirections), and have the squares “bounce” appropriately off allfour sides of the screen.
HINTS:
Create 2 arrays of size 1000 to hold random values between 1 and10 for the X movements and Y movements. This will allow yourrectangles to have independent movement speeds.
You will need to create a ActionListener class similar to whatis used in ReboundPanel class.
Inside the Actionistener class you
PayPal Gateway not configured
PayPal Gateway not configured