L
larkmore
I have recently begun the joys of ensuring that all of my GUI/Swing
code is thread safe by adding invokeLater() and invokeAndWait() methods
everywhere. As far as I can tell, all Swing classes are assumed to NOT
be thread safe. Does this include javax.swing.Timer? Specifically, I
use Timers all over the place for regularly scheduled tasks and when I
turn them on or off, or restart() them, do these also need to be
enclosed in invokeLater() and invokeAndWait() methods? Is it safe to
assume that the event handlers for Timers execute on the event
dispatching thread so that anything within these tasks is safe without
the extra protection? In case it matters my target JVM is the 1.3.1_07
JRE from Sun. Thanks for any help!
-Will
code is thread safe by adding invokeLater() and invokeAndWait() methods
everywhere. As far as I can tell, all Swing classes are assumed to NOT
be thread safe. Does this include javax.swing.Timer? Specifically, I
use Timers all over the place for regularly scheduled tasks and when I
turn them on or off, or restart() them, do these also need to be
enclosed in invokeLater() and invokeAndWait() methods? Is it safe to
assume that the event handlers for Timers execute on the event
dispatching thread so that anything within these tasks is safe without
the extra protection? In case it matters my target JVM is the 1.3.1_07
JRE from Sun. Thanks for any help!
-Will