I'm building a small application in netbeans,I use a JSpinner component to set the quantity of a product.How can I set the spinner to take only positive values?Is there a choice inside Netbeans that I can set or a method for the JSpinner
?
EXTRA:
spinner.setModel(new SpinnerNumberModel(0, 0, 20, 1));
for JSpinner you have to implements SpinnerNumberModel
Did you try to set the Minimum ?
http://docs.oracle.com/javase/7/docs/api/javax/swing/SpinnerNumberModel.html#setMinimum(java.lang.Comparable)
It works with r0ast3d's library reference: