import java.awt.*; import javax.swing.*; // This code is responsible for displaying the Balls public class BallPanel extends JPanel { public static final int WIDTH = 800; public static final int HEIGHT = 600; private static Ball[] balls; public BallPanel(Ball[] b) { balls = b; setPreferredSize(new Dimension(WIDTH, HEIGHT)); } // Display the image public void paintComponent(Graphics g) { super.paintComponent(g); for (int i=0; i