Drawing shapes in JPanel over an image
问题 I need to draw shapes (circle or free line) over an image that is shown in a JLabel of a JPanel. I based my code on the questions How to draw thin line with no gap while dragging the cursor? and Draw a circle using 2 mouse clicks. The code is bellow. The problem is that when I start drawing the image disappears and only reappears after I stop. If I comment the line super.paintComponent(g); that doesnt happen but when I draw the circle it maintains a path of the previous positions. public