Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I ran across the answer in this excellent blog post: <a href="http://www.pushing-pixels.org/?p=369" rel="nofollow noreferrer">http://www.pushing-pixels.org/?p=369</a></p> <blockquote> <p>With the current implementation, AWT terminates all its helper threads allowing the application to exit cleanly when the following three conditions are true:</p> <ul> <li>There are no displayable AWT or Swing components.</li> <li>There are no native events in the native event queue.</li> <li>There are no AWT events in java EventQueues.</li> </ul> </blockquote> <p>[...]</p> <blockquote> <p>In the current implementation this timeout is 1000 ms (or one second). What this effectively means that AWT is not shutdown immediately after disposing the last window in your application and processing all pending events. Instead, it wakes every second, checks for any pending or processed events during the sleep and continues sleeping if there have been any such events.</p> </blockquote> <p>The author goes on to say that his code posts an event to the EDT every 100ms in spite of the fact that the associated Window is no longer visible. This is exactly what happens in my case as well! The ScheduledExecutorService is posting events into the EDT, which in turn prevents AWT from shutting down, which in turn means that the ScheduledExecutorService will keep on posting more events.</p> <p>As an aside, I am surprised by the number of people that recommend the use of <code>JFrame.EXIT_ON_CLOSE</code>. Each to his own I guess, but I recommend you read <a href="http://findbugs.sourceforge.net/bugDescriptions.html#DM_EXIT" rel="nofollow noreferrer">http://findbugs.sourceforge.net/bugDescriptions.html#DM_EXIT</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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