Article View: borland.public.jbuilder.java.swing
Article #11508Re: Easy(?) Repaint(?) problem with JProgressBar
From: Matt Krevs
Date: Fri, 14 May 1999 00:00
Date: Fri, 14 May 1999 00:00
36 lines
1888 bytes
1888 bytes
This has been discussed a number of times on this forum. Check out dejanews for solutions. Basically you need to put your process intensive code into another thread. Call SwingUtilities.invokeLater() to update the progress bar. Check out the Java Tutorial for further hints. If you leave everything in the same thread then your progress bar wont update untill all of your processing has completed. Daniel R. J. Lind <daniel@synopsys.co.nz> wrote in message news:7hfsol$10t15@forums.borland.com... > Hi, > > I have a JButton linked to some code that has a series of steps. After each > step I change the value of the JProgressBar. Surprisingly enough, I am > wanting to show the progress through the steps to the user ; ) > > After you click the JButton it stays selcted until the series is finished. > During that time the JProgressBar isn't visually updated, but when the > series of steps is completed the JButton deselects and the JProgressBar > jumps to being at 100%. > > I am using the setValue method of the JProgressBar and the event is the > standard JButton ActionEvent. I have tried interspersing various repaint > type things to no avail. > > I've got to be doing something simple wrong surely ... > > Cheers, > > Daniel > > >
Technical Details
Message-ID:
<7hgb8g$1ca3@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7hfsol$10t15@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,9a882c5dcf41d7f3 X-Google-Attributes: gid111d45,public From: "Matt Krevs" <mattkrevs@flex.com.au> Subject: Re: Easy(?) Repaint(?) problem with JProgressBar Date: 1999/05/14 Message-ID: <7hgb8g$1ca3@forums.borland.com> X-Deja-AN: 477694709 References: <7hfsol$10t15@forums.borland.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Reply-To: "Matt Krevs" <mattkrevs@flex.com.au> Newsgroups: borland.public.jbuilder.java.swing