JSpinner is an integral component, it can be added to the components that it contains. You will have to experiment a bit to determine how to distinguish buttons from each other and from the text field. One quick and dirty way would be to check their coordinates.
I'm not sure if you want to iterate the components contained in JSpinner itself or those contained in the container returned JSpinner.getEditor(), so try both.
source
share