6.5.1. Progress Bars
A progress bar is a simple component—just a rectangle that is partially filled with color to indicate the progress of an operation. By default, progress is indicated by a string “n%”. You can see a progress bar in the bottom right of Figure 6.41.
You can construct a progress bar much as you construct a slider—by supplying the minimum and maximum value and an optional orientation:
progressBar = new JProgressBar(0, 1000); progressBar = new JProgressBar(SwingConstants.VERTICAL, 0, 1000);
You can also set the minimum and maximum with the
setMaximum methods. ...