[RangeSlider] Order of setting low and high values affects

Issue #728 new
Ross Marchant
created an issue

Steps to recreate:

  1. Add range slider to scene in SceneBuilder
  2. Set max and min to 0 and 100
  3. In controller initialize method, init the control using:
rangeSlider.setLowValue(10);
rangeSlider.setHighValue(80);
  1. Run program, low value for slider will not be set correctly.
  2. Change to the following and it will work:
rangeSlider.setHighValue(80);
rangeSlider.setLowValue(10);

Comments (8)

  1. Robert Ross

    This same issue exists with bindings and properties on these items, as well as min and max values/properties. The issue really seems to be that, fundamentally, there needs to be a way to "force" the old bounds out instead of preventing the new values from being set due to bounds checking.

  2. Michael Ellis

    Agree this is a serious issue. If your range sliders low and high value property are bound to other values the the work around is not always as simple as reordering the calls to setLowValue() and setHighValue()

  3. Nuntipat Narkthong

    I have found a simple work around by calling the setter twice

    rangeSlider.setLowValue(10);
    rangeSlider.setHighValue(80);
    rangeSlider.setLowValue(10);
    

    or

    rangeSlider.setHighValue(80);
    rangeSlider.setLowValue(10);
    rangeSlider.setHighValue(80);
    
  4. Sverre Moe

    I got this bug running JavaFX 11 with ControlsFX 9.0.0

    RangeSlider rangeSlider = new RangeSlider();
    rangeSlider.setMin(0.0);
    rangeSlider.setMax(100.0);
    rangeSlider.setLowValue(50.0);
    rangeSlider.setHighValue(75.0);
    

    Screenshot_20181107_190533.png

  5. Log in to comment