Answers for "jspinner only positive values"

0

jspinner only positive values

import javax.swing.JSpinner;
import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;

public class Main {
  public static void main(String[] argv) throws Exception {
    // Create a number spinner that only handles values in the range [0,100]
    int min = 0;
    int max = 100;
    int step = 5;
    int initValue = 50;
    SpinnerModel model = new SpinnerNumberModel(initValue, min, max, step);
    JSpinner spinner = new JSpinner(model);

  }
}
Posted by: Guest on November-24-2020

Code answers related to "jspinner only positive values"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language