I am still learning about classes and Object oriented programming. I created a "Ball" class to help me learn.
This class draws a ball to a JFrame.
To use it, I use the code:
where window is a JFrame.
This works very well, the problem is that when I create more than one ball, it draws the second ball and removes the
first ball.
This is the class:
Code for main class:
Could someone kindly show me how I can modify this class to be able to draw more than one ball simultaneously?
Thank you in advance.
This class draws a ball to a JFrame.
To use it, I use the code:
where window is a JFrame.
This works very well, the problem is that when I create more than one ball, it draws the second ball and removes the
first ball.
This is the class:
Code for main class:
Could someone kindly show me how I can modify this class to be able to draw more than one ball simultaneously?
Thank you in advance.