How to start a Timer on a mouse exit event and stop that same Timer on a mouse enter event?

和自甴很熟 提交于 2019-12-07 03:31:30

Don't keep creating a new Timer in your waitReminderList() method. You should define the Timer as a class variable.

Then you just stop/start it as required.

The problem is that you are creating a new Timer every time waitReminderList is called. Any previous running Timer objects will not be stopped. Since you want a single Timer move the reference outside the method, e.g. at class level.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!