Example usage for javax.swing JProgressBar getMinimum

List of usage examples for javax.swing JProgressBar getMinimum

Introduction

In this page you can find the example usage for javax.swing JProgressBar getMinimum.

Prototype

public int getMinimum() 

Source Link

Document

Returns the progress bar's minimum value from the BoundedRangeModel.

Usage

From source file:Main.java

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

    progress.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent evt) {
            JProgressBar comp = (JProgressBar) evt.getSource();
            int value = comp.getValue();
            int min = comp.getMinimum();
            int max = comp.getMaximum();
        }//from   w  w  w .  j av  a  2  s.  com
    });
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    int minimum = 0;
    int maximum = 100;
    JProgressBar progress = new JProgressBar(minimum, maximum);
    // Get the current value
    int value = progress.getValue();

    // Get the minimum value
    int min = progress.getMinimum();

    // Get the maximum value
    int max = progress.getMaximum();

    // Change the minimum value
    int newMin = 0;
    progress.setMinimum(newMin);/*  w  ww  .java  2 s .  co m*/

    // Change the maximum value
    int newMax = 256;
    progress.setMaximum(newMax);

    // Set the value; the new value will be forced into the bar's range
    int newValue = 33;
    progress.setValue(newValue);

}

From source file:com.ecrimebureau.File.Hash.java

public Hash(JInternalFrame jInternalFrame, JTextArea jTA, String alg, JProgressBar jProgressBar) {
    this.jTA = jTA;
    this.algorithim = alg;
    this.path = path;
    this.jProgressBar = jProgressBar;
    jProgressBar.setStringPainted(true);
    this.jInternalFrame = jInternalFrame;
    jProgressBar.setMinimum(0);//from  ww  w  .  java  2 s .c  o  m

    jProgressBar.setValue(jProgressBar.getMinimum()); //
}