Hi I am developing a new converter application using Swing,I need to use a progressbar to show the progress of converted files.How do i do it dynamically,ie as soon as a file gets converted the progressbar should update.Please Help
Mike Gerald<br />SCJP(1.4)<br />SCWCD<p>The Rising Sun
You use the setMaximum() method to set the JProgressBar's maximum value to the number of files you are converting and every time you convert a file you call setValue() on it with the count of files converted to move the progress bar. Be aware that you need to be converting your files in a seperate thread from the Swing event thread (i.e. the one that calls your gui listener methods). That same thread is responsable for updating the GUI.