Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3786

Re: Keeping GUI responsiv

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Lew" <lew@THRWHITE.remove-dii-this>
Subject Re: Keeping GUI responsiv
Message-ID <cLydnXdDLaASYOLVnZ2dnUVZ_q2dnZ2d@comcast.com> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
In-Reply-To <487f787a$0$4067$b9f67a60@news.newsdemon.com>
References <487f787a$0$4067$b9f67a60@news.newsdemon.com>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 34
Date Wed, 27 Apr 2011 15:46:55 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303919215 96.60.20.240 (Wed, 27 Apr 2011 10:46:55 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:46:55 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:3786

Show key headers only | View raw


  To: comp.lang.java.gui
Alex wrote:
>> I do some lengthy calculations in the event handling thread and
>> therefore my GUI is not responsive.
>> I know I could run the calculations in a worker thread, but I wonder
>> if there is not a simpler way.
>>
>> In C++ with the Qt class library there is a 'processEvents()' methods
>> that can be called from the event handling thread to process pending
>> (GUI) events. Is there something equivalent in Java or do I absolutely
>> need a worker thread?

Knute Johnson wrote:
> Yes.

<http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html>

Read the Swing tutorial.  It covers the need to do all GUI work, even 
construction, on the Event Dispatch Thread (EDT), the GUI thread.

Don't try to wiggle out of this.  It is a curiosity to me that some people 
look for a "way out" of having to put work not on the EDT and GUI only on the 
EDT.  That's the way it works.  Just do it right, and things work.  What's 
there to get "out" of?  How is it not simple enough the way it is?

Just learn the right way.

-- 
Lew

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: Keeping GUI responsiv "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
  Re: Keeping GUI responsiv "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000

csiph-web