Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Nigel Wade Newsgroups: comp.lang.java.programmer Subject: Re: Interrupt code while running (from Form) Date: Fri, 21 Oct 2016 16:38:23 +0100 Lines: 8 Message-ID: References: <6628a02c-9c5a-4cdc-8113-fcf13c972ea4@googlegroups.com> <17cd471e-65d9-47ed-b616-be748efd8fec@googlegroups.com> <191335d2-ae49-4ab0-b502-1d71d62b6bc0@googlegroups.com> <3419f58a-99c1-49c7-b4fe-2cb3b70313ad@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net ebBl584Ck9TD4fJsXEgvZw2BWSoFaTpCNbtT0eESilX1+Z42Us Cancel-Lock: sha1:FWw/siBZyGtY883ykJ+BBPe66q0= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:35858 On 21/10/16 15:38, Nigel Wade wrote: > But SwingWorker does it all for you, and doesn't hang your process when the EDT finishes. What reason is there not to use it? I should have added that SwingWorker implements the Future interface. For none Swing applications the equivalent class to use would be FutureTask. For the masochists there's always the "Good Old Days" of multi-threaded C programming in X/Motif applications using an implementation of threads which pre-dates POSIX pthreads. Passing events from your own threads to the Motif event loop was always good bit of fun for late on a Friday afternoon.