Re: Timer event appears to move window



Ed wrote

> The StatusBar code contains the following in the initialisation code:
> statusTimer=new Timer();

Note that there are two standard timer implementations, java.util.Timer
and javax.swing.Timer. Whenever you use timers in Swing to update some
part of the GUI you almost always want the later one since it makes
callback from the event dispatcher thread.

If you really want to update a Swing component from the callback of a
java.util.TimerTask you must in general use something like
java.awt.EventQueue.invokeLater() to ensure Swing thread safety. See
javax.swing.Timer for documentation and links on all this.


Regards,
--
Filip Larsen


.



Relevant Pages

  • Re: Problem with Swing Timer: timer-updated GUI occasionally stops updating
    ... All the Swing gui updating, all the Swing event handling, and all your ... seems that Timer events just stop firing all together. ... home dot woh dot rr dot com slash jbmatthews- Hide quoted text - ... It seems that if a computer clock is ...
    (comp.lang.java.gui)
  • Re: Thread and Timer
    ... which you blocked the message pump. ... callback timers are about the most useless entities in all of Windows. ... I'd like to use a timer inside a thread. ... UINT g_iMessage; ...
    (microsoft.public.vc.mfc)
  • Re: EndInvoke still required?
    ... and there will never be another receive callback to ... You could put a timer on the Form, or run a dedicated consumer thread. ... And creating a consumer thread for this one purpose seems wasteful as ... A single extra consumer thread isn't really that big of a deal, and it's not like queuing something on the thread pool is completely cost-free wouldn't otherwise have to worry about). ...
    (microsoft.public.dotnet.framework)
  • Re: [PATCH 2/4] Add cpufreq driver for the IBM PowerPC 750GX
    ... to delete the timer, and then manually set the frequency. ... The first is in the switch callback, ... means the call to _modify_PLLin _target worked. ...
    (Linux-Kernel)
  • Thread and Timer
    ... I'd like to use a timer inside a thread. ... CALLBACK and handle in OnTimer I never get the message. ... UINT g_iMessage; ... PostMessage, LPARAM ); ...
    (microsoft.public.vc.mfc)