Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2005

Tip: Looking for answers? Try searching our database.

JProgressBar bar not showing up till complete

Thread view: 
aotemp@hotmail.com - 22 Jul 2005 15:27 GMT
Hi thanks for reading.

Im sure the answer to this is simple, it just eludes me at this point.

Im tring to use a progress bar to simply show the progress of 55 files
being created and saved to disk.  However when I use the JProgressBar
in my code, it only shows up when the task is completed...  Obviously I

need it to be shown updating the entire time, seems like im missing
something pretty basic.

heres the code for your perusal, the updates occurs later in the code,
but since its not showing up until it is completed I believe the error
is here  + Thanks! :

               //start up progress FRAME
               JFrame jfrProgress = new JFrame("Creating Movie...");
               Container contentPane = jfrProgress.getContentPane();
               SpringLayout layout = new SpringLayout();
               contentPane.setLayout(layout);

               //set up progress BAR
               JProgressBar pbProgress;
               pbProgress = new JProgressBar(ISTARTFRAME,
iFinalFrame);
               pbProgress.setValue(ISTARTFRAM­E);
               pbProgress.setStringPainted(tr­ue);
               pbProgress.setString("Step 1 - Creating Files...");
               pbProgress.setSize(500, 40);

               //add progress bar to frame
               jfrProgress.getContentPane().a­dd(pbProgress);

               //display frame
               jfrProgress.setLocation(400, 300);
               jfrProgress.setSize(250, 100);
               pbProgress.setVisible(true);
               jfrProgress.setVisible(true);
aotemp@hotmail.com - 22 Jul 2005 15:29 GMT
also I read the faq, but none of the answers SEEM to pertain to this
case...
Thomas Weidenfeller - 22 Jul 2005 15:50 GMT
> also I read the faq, but none of the answers SEEM to pertain to this
> case...

I don't remember that there is something pertinent to progress bars in
the FAQ - and I should know :-) But Q3.1 and Q3.2 might apply.
Particular, because you didn't show us how you run the file creation and
how you do the updating (see Q2.4 in the FAQ for this one).

/Thomas

Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

6e - 22 Jul 2005 16:26 GMT
I found an example online that I plan to fully customize and recode its
located here for all who are searching

its the progress monitor demo...
http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
Andrew Thompson - 22 Jul 2005 16:32 GMT
>> also I read the faq, but none of the answers SEEM to pertain to this
>> case...
>
> I don't remember that there is something pertinent to progress bars in
> the FAQ - and I should know :-) But Q3.1 ..

Aaah yes..  That shows how thoroughly outdated is the
copy at physci [to which I linked as qn. 2.1 (on c.l.j.p.)].

> ..and Q3.2 might apply.

Yep.  That's what I'm thinking - 'blocking the EDT' sounds the
root cause, lacking evidence to the contrary..

> Particular, because you didn't show us how you run the file creation and
> how you do the updating (see Q2.4 in the FAQ for this one).

Splendid idea, Thomas.  

Signature

Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
Too Hot For Radio



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.