code: public synchronized ProgressBar setValue(int value) {
          if(value < min) {
              value = min;
          }
          if(value > max) {
              value = max;
          }
          if(this.value != value) {
              this.value = value;
              invalidate();
          }
          return this;
      }
docs: Updates the <i>value</i> of this progress bar, which will update the visual state. If the value passed in is
  outside the <i>minimum-maximum</i> range, it is automatically adjusted.
  @param value New value of the progress bar
  @return Itself