Class JSpinnerUtil


  • public class JSpinnerUtil
    extends java.lang.Object
    Utility class providing common methods for working with JSpinner components in Swing.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void setCommitsOnValidEdit​(javax.swing.JSpinner spinner, boolean newVal)
      Sets whether the JSpinner's text editor commits the value to the spinner model.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setCommitsOnValidEdit

        public static void setCommitsOnValidEdit​(javax.swing.JSpinner spinner,
                                                 boolean newVal)
        Sets whether the JSpinner's text editor commits the value to the spinner model.

        By default, JSpinners only update their value when enter is pressed or focus leaves the JFormattedTextField.

        Parameters:
        spinner - the JSpinner to modify.
        newVal - true to commit on valid edits, else false ( default JSpinner )