Clarification on how Codename One UITimer works

*爱你&永不变心* 提交于 2019-12-08 04:44:29

Yes, UITimer is an animation associated with the current Form. It doesn't draw anything but uses the builtin animation mechanism which runs on the EDT. Notice that if you leave a form and return to it the timer will continue e.g.:

  • Opened form at 0 time and set a timer for 15 seconds
  • Went to different form at 7 seconds
  • Returned to original after 30 seconds - the timer will fire immediately on return

You can also use a regular Timer or Thread. However, for your specific code EasyThread doesn't provide a benefit over a regular thread since it runs in an infinite loop. The benefit of EasyThread is in it's job processing ability.

Notice that you would need to use callSerially to return to the EDT when working with such timers/threads.

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