问题
wondering what is the major difference between these two: onClick and mouseClick..
回答1:
Assuming that you're talking about Java, the difference is right there in the documentation for MouseEvent:
Mouse Events
* a mouse button is pressed * a mouse button is released * a mouse button is clicked (pressed and released) * the mouse cursor enters the unobscured part of component's geometry * the mouse cursor exits the unobscured part of component's geometry
If you're talking about JavaScript, I'm going to assume that it's the difference between old style and new style event handling. But I've only ever used onClick, so can't give a definitive answer.
回答2:
Looks like you are confusing Java with Javascript. There is not onClick() method on Java APIs.
来源:https://stackoverflow.com/questions/1722029/what-is-the-difference-between-onclick-and-mouseclick