I read http://www.java2s.com/Code/Java/Swing-JFC/ProgressBarDemolongtask.htm on how to do a progress bar and up to now, I am still at a loss of how to implement one progress bar.

say I have I have 4 functions that stores some random text into a text file

-function a stores the text in textfile a
-function b stores the text in textfile b
-function c stores the text in textfile c
-function d stores the text in textfile d

How can I make the progress bar to display in such a way that

0-25% - function a is running
25-50% - function b is running
50-75% - function c is running
75-100% - function d is running
100%- done

can any kind soul please guide me? thanks