
-----------------------------------
matt271
Tue May 12, 2009 7:24 pm

javax swing freezing
-----------------------------------
swing keeps freezing on me

i have code like:
public boolean sendFile(File file, JProgressBar bar) {
        try {
            FileInputStream fstream = new FileInputStream(file);

            int sum = 0;
            bar.setMaximum((int)file.length());

            int read;
            byte

but it will not update the prog bar until its done. also while its loading, the gui is frozen.

i tried things like Thread.sleep(1); it didnt work.

in VB i would just say DoEvenets but i dont think java works like that.

also i tried running this in another thread. like i create a new thread then call my method. it still freezes

there has to be a way to make this not freeze, any help plz?
