So far i managed to get a circle to show itself on the JPanel when the mouse is clicked. The only problem i have is that it doesn't show multiple circles when clicked, instead it deletes the pervious one. I have a method called paint() where the graphics is drawn.
From what i read is that i need to make a array list of Shape at the beggining of my class and add a for loop in the paint() method.
For loop at the bottom of paint() method.
But this doesn't work as it displays text only since it is in front of the loop. Could you please show me some tutorial or another post here so i can solve this? Also some people override the paintGraphics() method, is this necessary? Or i can create my own method? Should i also store the cooridnates from mouseX and mouseY somewhere as well?