FormsFX
FormsFX copied to clipboard
Setting a custom StringConverter on an IntegerField can break the Spinner in SimpleIntegerControl
One can set a custom StringConverter on an IntegerField via IntegerField.format(..) The default control for IntegerField, SimpleIntegerControl is a wrapper around an Integer based spinner. Setting a custom StringConverter on the field seems to break the spinner up-down feature, as the spinner is not aware of the StringConverter on the field. Editing the field by typing into the text-field part of the spinner works as expected.
Workaround:
- Override SimpleIntegerControl and apply the custom converter in the "initializeParts" method.
@Override
public void initializeParts() {
super.initializeParts();
editableSpinner.getValueFactory().setConverter(myCustomConverter);
}