Make JSpinner only read numbers but also detect backspace
you are right JFormattedTextField isn’t correctly implemented to JSpinner, you have implements DocumentFilter for filtering of un_wanted Chars typed from keyboad or pasted from ClipBoard, (thanks to @StanislavL) you have solve by yourself issues with selectAll() on focusGained() wrapped into invokeLater(), example import java.awt.BorderLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; import javax.swing.SwingUtilities; import … Read more