Could someone please tell me how I can do this: I have a GUI class, and I have a class that does all the calculations for the program (happens to be a file decryptor). I want the GUI to start the decryption, and update a JProgressBar. Which I know how to do, HOWEVER, it causes the processing to take a very, very long time. I believe if I put the processing class in a different thread than the GUI, it will work better (is that correct?). But I don't know how to have the two threads communicate (specifically transfer the total progress from the decrypting class to the gui).

Any help?