I am trying to write a Java application which draws multiple balls on screen which bounce off of the edges of the frame. I can successfully draw one ball. However when I add
You need to use two completely distinct classes here -- one for BallContainer which extends JPanel and is the component that draws the Balls, and another for Ball which does not extend anything but rather holds the coordinates and Color of a Ball. BallContainer should hodl a List that it iterates through when it moves them and when it paints them.