0

Is it possible to add a character or a String after the value in a JSpinner (something like "xxx€", "xxx months", xxx being the value) ?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
IKSDEY
  • 5
  • 3

1 Answers1

3

Check out the section from the Swing tutorial on Specifiying Spinner Formatting.

The default editor of the spinner is a JFormattedTextField. So you can access this and set your own formatting.

If you have never used a JFormattedTextField before then the tutorial also has a section on How to Use Formatted Text Fields to help you in creating the mask you want to use.

camickr
  • 321,443
  • 19
  • 166
  • 288