public class RangeSliderUtil extends Object
Modifier and Type | Method and Description |
---|---|
static JSlider |
createRangeSlider(int imin,
int imax)
Constructs a range-capable slider instance.
|
static int[] |
getSliderRange(JSlider slider)
Returns the range represented by a range-capable slider.
|
static void |
setSliderRange(JSlider slider,
int ilo,
int ihi)
Sets the range represented by a range-capable slider.
|
public static JSlider createRangeSlider(int imin, int imax)
com.jidesoft.swing.RangeSlider
is returned, but if that fails it falls back to the
(uglier, less capable) local variant.
JIDE failure can happen in one of (at least?) two ways. First, if the current Look&Feel is not supported by the JIDE component, which doesn't support for example Nimbus(?). Second, if the JIDE class refers to a JRE class that is not present; this appears to happen on OSX Java 10, where a java.lang.ClassNotFoundException is reported for com.sun.java.swing.plaf.windows.WindowsLookAndFeel, which has apparently been withdrawn in that environment. Tweaking the JIDE source to avoid looking for that class, or to fail more gracefully, or upgrading to a later JIDE-OSS version, could probably work to avoid the latter problem. However, there seems to be a lot of UI magic in the JIDE component (probably unavoidable to get full L&F integration), so it's wise to have a fallback.
imin
- minimum valueimax
- maximum valuepublic static int[] getSliderRange(JSlider slider)
slider
- range-capable slider (presumably created by this class)public static void setSliderRange(JSlider slider, int ilo, int ihi)
slider
- range-capable slider (presumably created by this class)ilo
- range lower valueihi
- range upper valueCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.