Creating a JProgressBar Component

A progress bar is used to visually indicate how much a task has been progressed. A progress bar can be oriented horizontally (left-to-right) or vertically (bottom-to-top). By default, the orientation is horizontal.

See also Creating a Progress Monitor Dialog.

// Create a horizontal progress bar int minimum = 0; int maximum = 100; JProgressBar progress = new JProgressBar(minimum, maximum); // Create a vertical progress bar minimum = 0; maximum = 100; progress = new JProgressBar(JProgressBar.VERTICAL, minimum, maximum);

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.