Hi Hendre

You are probably doing the import work from the main thread. Thus your 
progress bar can't actually be repainted, as the main application thread 
is kept busy with all the importing work.

You must always do the data processing work in a background thread, or 
better still, make use of a thread pool. Have a look at the 
java.util.concurrency package.
Then you do a call-back from the background thread to the main UI thread 
for repainting using something like:
SwingUtilities.invokelater(new Runnable(){
    public void run(){
       progressbar.update(...)
...
    }
});

I would recommend that you have a look at java.sun.com for their 
tutorials. There is a lot of info on how to use multi-threaded 
applications with Swing.

Cheers,
 Herman

Hendre Louw wrote:
>
> Hi All
>
>  
>
> Another question! I am importing 100 000 records and have a progress 
> bar to indicate progress. After every 100 records I update the 
> progress bar, but nothing happens. The progress bar does not update. 
> It seems that messages to the UI are blocked while I am importing. How 
> do I get the GU to refresh?
>
>  
>
> Hendre Louw
>
> Skype: hendrel
>
>
> >
>
> __________ NOD32 1.1685 (20060731) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>

-- 

---------------------------------------------------
Herman Lintvelt                 Polymorph Systems

Mobile: +27-82-339-6932
Web:    http://www.polymorph.co.za
Skype:  hermanlintveltza
---------------------------------------------------


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CTJUG Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/CTJUG-Forum
For the ctjug home page see http://www.ctjug.org.za
-~----------~----~----~----~------~----~------~--~---

Reply via email to