如果我有一个MouseMotionListener,是否会执行多个mouseDragged方法并且可以同时运行?这是一张图片:
Time -> 0------------1---------------2------------------------3-------------------------------4------
Mouse Moved--mouseDragged()--Method crunches numbers--Method Still Crunching Numbers--Method keeps doing stuff
Mouse Moved--------------mouseDragged()------------------Starts to do stuff
OR:
Mouse Moved
mouseDragged()
Stuff happens
Mouse Moved again but nothing happens
More stuff happens
Stuff done
mouseDragged()
Stuff
Done
你应该明白这个想法。谢谢!
我知道EDT,但不确定它是如何工作的。
答案 0 :(得分:0)
docs没有说明mouseDragged/mouseMoved
方法的并发调用。我相信它被称为顺序。如果i+1
- mouseDragged/mouseMoved
回调的调用在i
完成时仍然处理