Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Trivially, as long as the synchronized methods do not execute on the <a href="http://download.oracle.com/javase/6/docs/api/java/awt/EventQueue.html" rel="nofollow"><code>EventQueue</code></a>, they won't block the event dispatch thread. Conversely, a method executing on another thread should <em>always</em> use the <a href="http://download.oracle.com/javase/6/docs/api/java/awt/EventQueue.html" rel="nofollow"><code>EventQueue</code></a> to dispatch code via <code>invokeLater()</code>, <code>invokeAndWait()</code>, or a related mechanism such as <a href="http://download.oracle.com/javase/6/docs/api/javax/swing/Timer.html" rel="nofollow"><code>javax.swing.Timer</code></a> or <a href="http://download.oracle.com/javase/6/docs/api/javax/swing/SwingWorker.html" rel="nofollow"><code>javax.swing.SwingWorker</code></a>. As a practical matter, these are reliable. The examples <em>may</em> be correct, but they should be examined from this perspective.</p> <p>The <a href="http://download.oracle.com/javase/6/docs/api/java/awt/EventQueue.html" rel="nofollow"><code>EventQueue</code></a> API says, "The only requirements are that events...are dispatched...in the same order as they are enqueued." In my opinion, this is tantamount to the "happens-before" relation of <a href="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/package-summary.html" rel="nofollow"><code>java.util.concurrent</code></a> and the JLS. A more detailed discussion may be found <a href="https://groups.google.com/forum/#!msg/comp.lang.java.gui/sWKy5Oo8s3E/IqcnQ7Y6Sa0J" rel="nofollow">here</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload