I had the same problem with spinner control. Your error is described here: JDK-8094205
Here is the last comment:
Jonathan Giles added a comment - Dec, 15 2014 12:59
Fixed locally in my repo, this week it will be released on the 8u60 repository as soon as it opens. Now the input of the text editor is fixed when adding / decrements are called (although the value is still not fixed when the focus is lost).
Unit tests:
javafx.scene.control.SpinnerTest.test_rt_39655_decrement() javafx.scene.control.SpinnerTest.test_rt_39655_increment()
Changelog: http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/89ca7d3f699e
Here is my reception on an Autocommit answering machine. This one will automatically commit whatever the factory accepts.
public class SpinnerAutoCommit<T> extends Spinner<T> { public SpinnerAutoCommit() { super(); addListenerKeyChange(); } public SpinnerAutoCommit(int min, int max, int initialValue) { super(min, max, initialValue); addListenerKeyChange(); } public SpinnerAutoCommit(int min, int max, int initialValue, int amountToStepBy) { super(min, max, initialValue, amountToStepBy); addListenerKeyChange(); } public SpinnerAutoCommit(double min, double max, double initialValue) { super(min, max, initialValue); addListenerKeyChange(); } public SpinnerAutoCommit(double min, double max, double initialValue, double amountToStepBy) { super(min, max, initialValue, amountToStepBy); addListenerKeyChange(); } public SpinnerAutoCommit(ObservableList<T> items) { super(items); addListenerKeyChange(); } public SpinnerAutoCommit(SpinnerValueFactory<T> valueFactory) { super(valueFactory); addListenerKeyChange(); } private void addListenerKeyChange() { getEditor().textProperty().addListener((observable, oldValue, newValue) -> { commitEditorText(); }); } private void commitEditorText() { if (!isEditable()) return; String text = getEditor().getText(); SpinnerValueFactory<T> valueFactory = getValueFactory(); if (valueFactory != null) { StringConverter<T> converter = valueFactory.getConverter(); if (converter != null) { T value = converter.fromString(text); valueFactory.setValue(value); } } } }