I made a java chat application which transfers files from between server and client.

The thing is that i used sleep() method to make the progressbar go slow.

I want the progress bar to progress according to the progress of work done..

I dont know about EventQueue ...

Any solutions....?

Read the JavaDoc for the SwingWorker class. The introductory section explains a bit about EDT and has a sample code that shows how to use a progress bar with a long-running process.