Class SpinnerUtils

java.lang.Object
org.pepsoft.util.swing.SpinnerUtils

public final class SpinnerUtils extends Object
  • Method Details

    • setMinimum

      public static void setMinimum(JSpinner spinner, Comparable<?> newMinimum)
      Set the minimum of a JSpinner with a number spinner model to a new value, adjusting the current value first if necessary.
      Parameters:
      spinner - The spinner of which to set the minimum. Must have a SpinnerNumberModel.
      newMinimum - The value to set the minimum to. Must be a Number.
    • setMinimum

      public static void setMinimum(SpinnerNumberModel model, Comparable<?> newMinimum)
      Set the minimum of a number spinner model to a new value, adjusting the current value first if necessary.
      Parameters:
      model - The model of which to set the minimum.
      newMinimum - The value to set the minimum to. Must be a Number.
    • setMaximum

      public static void setMaximum(JSpinner spinner, Comparable<?> newMaximum)
      Set the maximum of a JSpinner with a number spinner model to a new value, adjusting the current value first if necessary.
      Parameters:
      spinner - The spinner of which to set the maximum. Must have a SpinnerNumberModel.
      newMaximum - The value to set the maximum to. Must be a Number.
    • setMaximum

      public static void setMaximum(SpinnerNumberModel model, Comparable<?> newMaximum)
      Set the maximum of a number spinner model to a new value, adjusting the current value first if necessary.
      Parameters:
      model - The model of which to set the maximum.
      newMaximum - The value to set the maximum to. Must be a Number.