code: protected void updateHistBar (int val)
      {
          // we may need to figure out the new history offset amount..
          if (!_histOffsetFinal && _history.size() > _histOffset) {
              Graphics2D gfx = getTargetGraphics();
              if (gfx != null) {
                  figureHistoryOffset(gfx);
                  gfx.dispose();
              }
          }
  
          // then figure out the new value and range
          int oldval = Math.max(_histOffset, val);
          int newmaxval = Math.max(0, _history.size() - 1);
          int newval = (oldval >= newmaxval - 1) ? newmaxval : oldval;
  
          // and set it, which MAY generate a change event, but we want to ignore it so we use the
          // _settingBar flag
          _settingBar = true;
          _historyModel.setRangeProperties(newval, _historyExtent, _histOffset,
                                           newmaxval + _historyExtent,
                                           _historyModel.getValueIsAdjusting());
          _settingBar = false;
      }
docs: Update the history scrollbar with the specified value.