Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4447261

JSpinner with SpinnerNumberModel can throw IllegalArgumentException

XMLWordPrintable

    • beta2
    • generic
    • generic

      A SpinnerNumberModel can be used with a JSpinner to limit the value that the spinner can take to a maximum and a minimum. When using the spinner's up or down arrows, the spinner will not go past the min or max. Currently, the up and down arrow keys can be used to increment/decrement the spinner values as well. However, an IllegalArgumentException is thrown when the value tries to exceed the max or min.

      Compile and run the attached test code. Put the focus on the text field part of the spinner and press the up key repeatedly. After the spinner value reaches 20, the set maximum, an IllegalArgumentException will be thrown for every time the up key is pressed.

            shickeysunw Shannon Hickey (Inactive)
            shickeysunw Shannon Hickey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: