Hopefully this helps 3.5 years later for anyone searching for answers to the same problem :)
When you click on the mouse you will fire the following events.
- MousePressed
- MouseDragged (if you pressed hard enough to move the
cursor slightly)
- MouseReleased
- MouseClicked
I ran into this very problem making the events the lazy way in Netbeans using their Forms utility.
I found the accidental dragging of my mouse between Press and Release is what killed the click event.
Working as intended or a minor failing of the JVM and Netbeans? I don't know.
The work-around I used was to register a MousePressed and MouseReleased event to simulate the clicking.
If the Press and Release do not happen on the same Object, MouseReleased will do nothing.
If the Press and Release happen on the same Object, I call my method with appropriate parameters to consume the event.
Note that since I'm handling clicks on the JFrame, so it IS the only swing object, so I'm passing a Point object of the mouse coords and comparing both, ensuring they fall within the specified rectangle.