JSpinner : Java Glossary


To see a JSpinner in action, look at the Font Shower Amanuesis that uses one to let you control the font size. You can use the arrow keys to change the value, or you can type in a new value. Here is the basic code to make one work. You can customise how the spinner values jump by writing your own SpinnerModel. You can customise how the display looks and how you can edit it by writing a custom JComponent and using JSpinner. setEditor. If you want to roll your own, it is wise to look at Oracle’s implementations to understand just what these classes do. The source is in J:\Program Files\java\jdk1.8.0_131\ \src.zip. Here is a crude example of how you would spin a formatted value. For a more real-world example see the source code for the Canadian Tax Calculator.


Learning More

Oracle’s Javadoc on JSpinner class : available:
Oracle’s Javadoc on SpinnerModel interface : available:
Oracle’s Javadoc on AbstractSpinnerModel class : available:
Oracle’s Javadoc on SpinnerDateModel class : available:
Oracle’s Javadoc on JSpinner.DateEditor : available:
Oracle’s Javadoc on SpinnerListModel class : available:
Oracle’s Javadoc on JSpinner.ListEditor : available:
Oracle’s Javadoc on SpinnerNumberModel class : available:
Oracle’s Javadoc on JSpinner.NumberEditor : available:

This page is posted
on the web at:


Optional Replicator mirror
of mindprod.com
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number