Daniel Silva
Daniel Silva

Reputation: 331

How to reset a JSpinner to min value

I need to reset a JSpinner to its min value. I've tried get it from model:

spinner.setValue(((SpinnerNumberModel) spinner.getModel()).getMinimum());

But i've got IllegalArgumentException...

Upvotes: 0

Views: 3683

Answers (1)

Sbodd
Sbodd

Reputation: 11454

That can happen if your model doesn't have a minimum, or if its minimum is a Comparable that is not a Number.

Upvotes: 1

Related Questions