i have a timer that counts the spent time and other calculations, but i need when i click on pause button the timer to pause, and then resume. How do i pause it?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is no pause & resume API for Timer. You will need to code for it.
Here is example which pauses and resumes Timer on mouseover.
http://www.java2s.com/Code/Java/Swing-JFC/Anappletthatcountsdownfromaspecifiedtime.htm
Hope this helps.