Java Swing How to - Create a horizontal progress bar








Question

We would like to know how to create a horizontal progress bar.

Answer

/*from  w  ww  .j  a v  a  2s .  c  om*/
import javax.swing.JProgressBar;

public class Main {
  public static void main(String[] argv) throws Exception {
    int minimum = 0;
    int maximum = 100;
    JProgressBar progress = new JProgressBar(minimum, maximum);

  }
}