title: In Java, how can I use mouseClicked without calling mousePressed and mouseReleased?
body: <p>I'm writing a program to draw a bouncing ball, and then the user can draw rectangles on the screen, and the ball bounces off the rectangles.  A flag is set to true in mousePressed, and as long as the flag is true, a rectangle is drawn from the starting point to the current point (using mouseDragged).  The flag is set to false in mouseReleased.  I'll be using mouseClicked to erase the rectangle that is clicked (if there is one).  The problem I'm encountering is that on mouseClicked, mousePressed and mouseReleased are both called.  Is there a way we can make it not do that?</p>