Class TextFields


  • public class TextFields
    extends Object
    A class containing useful customizations for the JavaFX TextField. Note that this class is experimental and the API may change in future releases. Note also that this class makes use of the CustomTextField class.
    See Also:
    CustomTextField
    • Method Detail

      • createClearableTextField

        public static TextField createClearableTextField()
        Creates a TextField that shows a clear button inside the TextField (on the right hand side of it) when text is entered by the user.
      • createClearablePasswordField

        public static PasswordField createClearablePasswordField()
        Creates a PasswordField that shows a clear button inside the PasswordField (on the right hand side of it) when text is entered by the user.
      • bindAutoCompletion

        public static <T> AutoCompletionBinding<T> bindAutoCompletion​(TextField textField,
                                                                      Callback<AutoCompletionBinding.ISuggestionRequest,​Collection<T>> suggestionProvider,
                                                                      StringConverter<T> converter)
        Create a new auto-completion binding between the given textField and the given suggestion provider. The TextFields API has some suggestion-provider builder methods for simple use cases.
        Parameters:
        textField - The TextField to which auto-completion shall be added
        suggestionProvider - A suggestion-provider strategy to use
        converter - The converter to be used to convert suggestions to strings
      • bindAutoCompletion

        public static <T> AutoCompletionBinding<T> bindAutoCompletion​(TextField textField,
                                                                      Callback<AutoCompletionBinding.ISuggestionRequest,​Collection<T>> suggestionProvider)
        Create a new auto-completion binding between the given textField and the given suggestion provider. The TextFields API has some suggestion-provider builder methods for simple use cases.
        Parameters:
        textField - The TextField to which auto-completion shall be added
        suggestionProvider - A suggestion-provider strategy to use
        Returns:
        The AutoCompletionBinding
      • bindAutoCompletion

        public static <T> AutoCompletionBinding<T> bindAutoCompletion​(TextField textField,
                                                                      T... possibleSuggestions)
        Create a new auto-completion binding between the given TextField using the given auto-complete suggestions
        Parameters:
        textField - The TextField to which auto-completion shall be added
        possibleSuggestions - Possible auto-complete suggestions
        Returns:
        The AutoCompletionBinding