Question: In Java Write a Java program that does the following: Creates a 500 x 500 window Creates an ActiveObject that displays a circular FilledOval that
Write a Java program that does the following: Creates a 500 x 500 window Creates an ActiveObject that displays a circular FilledOval that moves in a straight, diagonal line Places 4 FilledRects around the edges of the window, making a frame Makes the FilledOval "bounce off" the FilledRects when it hits them. If it hits the left or right FilledRect, it should reverse the x component of the Filled Oval's movement. If it hits the top or bottom FilledRect, it should reverse they component of the FilledOval's movement. You should have two classes: one, named WallBallWindow, which extends WindowController, and another, WallBall, which extends ActiveObject. NOTE: You will have a MUCH easier time of this if you define the FilledRects in the WallBall class rather than the WallBallWindow class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
