• Post Reply Bookmark Topic Watch Topic
  • New Topic

jspinner minimum value

 
Maha Hassan
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to set the jspinner to a min value and a max value that it can not exceed
how to do this
and also if the user entered a value in the text field next to the spinner how to check that it is valid ??
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What did you try already? To use a JSpinner properly, you must use a SpinnerModel. It is the Spinner models that determines the range of values that can be selected. There are different implementations of SpinnerModel for different uses (SpinnerNumberModel, SpinnerDateModel, etc).

The API docs and the Java Tutorial section for JSpinner are quite useful.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!