What is JProgressBar - Java Swing

Java examples for Swing:JProgressBar

Introduction

JProgressBar displays the progress of a task.

JProgressBar can be horizontal or vertical.

JProgressBar has three values: the current value, the minimum value, and the maximum value.

Create a horizontal progress bar with current, minimum, and maximum values set to 0, 0, and 100, respectively.

JProgressBar hpBar1 = new JProgressBar();

Create a horizontal progress bar with current, minimum, and maximum values set to 20, 20, and 200, respectively.

JProgressBar hpbar2 = new JProgressBar(SwingConstants.HORIZONTAL, 20, 200);

Create a vertical progress bar with current, minimum, and maximum values set to 5, 5 and 50, respectively.

JProgressBar vpBar1 = new JProgressBar(SwingConstants.VERTICAL, 5, 50);

Related Tutorials