Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > GUI progress indicators in java not working

GUI progress indicators in java not working
Thread Tools
Mac Enthusiast
Join Date: Mar 2000
Location: atx, usa
Status: Offline
Reply With Quote
Jun 23, 2004, 01:54 PM
 
hi,

i'm making a pure java app and i am having trouble updating the view while i am processing the data.

i have a Frame with both a Label and JProgressBar in it. i am processing data that must go through several iterative steps. i want there to be visual feedback while the processing takes place.

i currently have myLabel.setText("starting step N") at the beginning of each step and one call at the end saying "process complete". i also have System.out calls along with the above calls, so i can see what is happening in the terminal. during the last step (which takes the longest amount of time) i call progressBar.setValue(progressBar.getValue() + 1) after each iteration. there are 100 steps and i have the progress bar min/max set to 0/100.

when i run the program, no updates are made to either the label or progress bar, until the end when "process complete" shows and the progress bar goes from 0 - 100%.

it's been a while since i've done any java, so i may be missing something fundamental. also, i've run this on os x and windows, and the behaviour is the same. os x has java 1.4.1 if that matters at all.
"do unto others as you would have them do unto you" begins with yrself.

"He that fights for Allah's cause fights for himself. Allah does not need His creatures' help." -koran, the spider, 29:7
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:37 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2