How to add zero addition to JSpinner?
Since the spinner creates itself JFormattedTextField, I cannot just pass this format to the JFormattedTextField constructor.
There is no way to set the formatting in the existing JFormattedTextField?
What I want: value = 37, editor = "0037"
UPDATE:
I tried this as suggested:
JSpinner mySpinner = new JSpinner();
mySpinner.setEditor(
new JSpinner.NumberEditor(mySpinner, "####"));
and the result will not change at all to the presentation of the counter data. This seems like a reasonable decision; Has anyone tried this successfully, so I can be sure that it is just peeling something in my own application?
source
share