Class SpinnerValueFactory.ListSpinnerValueFactory<T>

Type Parameters:
T - The type of the elements in the List.
Enclosing class:

public static class SpinnerValueFactory.ListSpinnerValueFactory<T>
extends SpinnerValueFactory<T>
A SpinnerValueFactory implementation designed to iterate through a list of values.

Note that the default converter is implemented simply as shown below, which may be adequate in many cases, but it is important for users to ensure that this suits their needs (and adjust when necessary):

 setConverter(new StringConverter<T>() {
     @Override public String toString(T value) {
         if (value == null) {
             return "";
         return value.toString();

     @Override public T fromString(String string) {
         return (T) string;
JavaFX 8u40
  • Property Details

  • Constructor Details

    • ListSpinnerValueFactory

      public ListSpinnerValueFactory​(ObservableList<T> items)
      Creates a new instance of the ListSpinnerValueFactory with the given list used as the list to step through.
      items - The list of items to step through with the Spinner.
  • Method Details

    • setItems

      public final void setItems​(ObservableList<T> value)
      Sets the underlying data model for the ListSpinnerValueFactory. Note that it has a generic type that must match the type of the Spinner itself.
      value - the list of items
    • getItems

      public final ObservableList<T> getItems()
      Returns an ObservableList that contains the items currently able to be iterated through by the user. This may be null if setItems(javafx.collections.ObservableList) has previously been called, however, by default it is an empty ObservableList.
      An ObservableList containing the items to be shown to the user, or null if the items have previously been set to null.
    • itemsProperty

      public final ObjectProperty<ObservableList<T>> itemsProperty()
      The underlying data model for the ListView. Note that it has a generic type that must match the type of the ListView itself.
      See Also:
      getItems(), setItems(ObservableList)