🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #99

Re: progress bar during a critical operation in the event dispatch thread

#99
From: Kevin Dean [TeamB]
Date: Sun, 22 Jan 2006 14:51
31 lines
2265 bytes
Tony wrote:

>1. Display and updates of the progress bar are UI operations
>    which must take place on a Swing thread.
>2. Swing thread will not resume until actionPerformed method
>    exits.

The recommended way to do that in Swing is to spin off the methods in a 
background thread.  You would display the progress bar in a modal dialog 
with no "Cancel" button (unless you want the ability to cancel the 
operation) and with the "Close" button in the upper right corner disabled. 
  To update the progress bar, you would post events to the Swing thread.  You can find a tutorial here:

http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html

And some other references on Google:

http://www.google.ca/search?q=swing+background+event+progress+bar

-- 
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <xn0ehj7pz1k38m000-kdean@www.teamb.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43d3363e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,dfff19faba996f35
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Kevin Dean [TeamB]" <NkOdSePaAnM@datadevelopment.com>
Subject: Re: progress bar during a critical operation in the event dispatch thread
Newsgroups: borland.public.jbuilder.java.swing
References:  <43d3363e$1@newsgroups.borland.com>
Organization: Dolphin Data Development Ltd.
User-Agent: XanaNews/1.17.6.6
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobrp]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
Message-ID: <xn0ehj7pz1k38m000-kdean@www.teamb.com>
X-Ref: newsgroups.borland.com ~XNS:000004C8
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
NNTP-Posting-Host: 70.27.198.51
Date: 22 Jan 2006 07:51:51 -0700
X-Trace: newsgroups.borland.com 1137945111 70.27.198.51 (22 Jan 2006 07:51:51 -0700)
Lines: 31
X-Authenticated-User: kdean
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail