How can I bring my shape that I painted with paintComponent and clicked with a mouse to front?
问题 I have a program that painted three different shapes(circle, triangle, and square) and I try to drag them with a mouse. What I want to do is to bring to the front that shape that is clicked. Can I pass the argument together with repaint() to tell a program that for example circle that is clicked has to be painted last, or is it possible to create three different paint methods to keep track of paint ordning? Another question is my if-loop, it works just fine to drag square through circle and