A DESCRIPTION OF THE REQUEST :
Currently the control javafx.scene.control.Spinner does not provide a property promptText.
We need to access its underlying editor in order to modify this display value (prompt text is displayed when the editor text field is empty).
JUSTIFICATION :
This would make easier to define Spinner in FXML as we cannot directly modifiy the value of the editor in an FXML file.
Other controls built ontop of TextField like DatePicker do have a promptText property that work as intended. it is odd that Spinner does not have this property.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Setting the prompText property on the Spinner will change the promptText on the spinner's editor automatically.
ACTUAL -
The javafx.scene.control.Spinner does not have a promptText property. We cannot define the promptText of the spinner in FXML.
CUSTOMER SUBMITTED WORKAROUND :
The developper can set a promptText on the Spinner by accessing its editor once the FXML has loaded by doing the following in the FXML's controller class:
public final class MyFormController implements Initializable {
@FXML
private Spinner mySpinner;
@Override
public void initialize(final URL url, final ResourceBundle bundle) {
mySpinner.getEditor().setPromptText("Prompt");
}
}
Currently the control javafx.scene.control.Spinner does not provide a property promptText.
We need to access its underlying editor in order to modify this display value (prompt text is displayed when the editor text field is empty).
JUSTIFICATION :
This would make easier to define Spinner in FXML as we cannot directly modifiy the value of the editor in an FXML file.
Other controls built ontop of TextField like DatePicker do have a promptText property that work as intended. it is odd that Spinner does not have this property.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Setting the prompText property on the Spinner will change the promptText on the spinner's editor automatically.
ACTUAL -
The javafx.scene.control.Spinner does not have a promptText property. We cannot define the promptText of the spinner in FXML.
CUSTOMER SUBMITTED WORKAROUND :
The developper can set a promptText on the Spinner by accessing its editor once the FXML has loaded by doing the following in the FXML's controller class:
public final class MyFormController implements Initializable {
@FXML
private Spinner mySpinner;
@Override
public void initialize(final URL url, final ResourceBundle bundle) {
mySpinner.getEditor().setPromptText("Prompt");
}
}