Class TextInput

    • Property Detail

      • floatText

        public final StringProperty floatTextProperty
        A String to be shown as a float text. A floatText acts similar to a promptText unless a focus is received by the textfield. On receiving focus, the floatText floats on top of the TextInput instead of disappearing.

        Style Guide:

        For styling the float label, which is added as a direct child of the TextInput control, you can use the style-class "float".
        See Also:
        getFloatText(), setFloatText(String)
      • errorValidator

        public final ObjectProperty<Function<String,​String>> errorValidatorProperty
        Sets an error message that will be displayed below the TextInput control. The Function evaluates the text from the TextInput control and returns a String with the error message. If the returned String is null or empty, no error message will be displayed.

        Style Guide:

        When the function returns a non-empty String, a PseudoClass "error" is added to the TextInput. For styling the error label, which is added as a direct child of the TextInput control, you can use the style-class "error".
        See Also:
        getErrorValidator(), setErrorValidator(Function)
    • Constructor Detail

      • TextInput

        public TextInput()
    • Method Detail

      • getPromptText

        public final String getPromptText()
        Gets the value of the property promptText.
        Property description:
        The prompt text to display in the TextInput, or null if no prompt text is displayed.
      • setPromptText

        public final void setPromptText​(String value)
        Sets the value of the property promptText.
        Property description:
        The prompt text to display in the TextInput, or null if no prompt text is displayed.
      • getText

        public final String getText()
        Gets the value of the property text.
        Property description:
        The textual content of this TextInput.
      • setText

        public final void setText​(String value)
        Sets the value of the property text.
        Property description:
        The textual content of this TextInput.
      • getFloatText

        public final String getFloatText()
        Gets the value of the property floatText.
        Property description:
        A String to be shown as a float text. A floatText acts similar to a promptText unless a focus is received by the textfield. On receiving focus, the floatText floats on top of the TextInput instead of disappearing.

        Style Guide:

        For styling the float label, which is added as a direct child of the TextInput control, you can use the style-class "float".
      • setFloatText

        public final void setFloatText​(String floatText)
        Sets the value of the property floatText.
        Property description:
        A String to be shown as a float text. A floatText acts similar to a promptText unless a focus is received by the textfield. On receiving focus, the floatText floats on top of the TextInput instead of disappearing.

        Style Guide:

        For styling the float label, which is added as a direct child of the TextInput control, you can use the style-class "float".
      • floatTextProperty

        public final StringProperty floatTextProperty()
        A String to be shown as a float text. A floatText acts similar to a promptText unless a focus is received by the textfield. On receiving focus, the floatText floats on top of the TextInput instead of disappearing.

        Style Guide:

        For styling the float label, which is added as a direct child of the TextInput control, you can use the style-class "float".
        See Also:
        getFloatText(), setFloatText(String)
      • errorValidatorProperty

        public final ObjectProperty<Function<String,​String>> errorValidatorProperty()
        Sets an error message that will be displayed below the TextInput control. The Function evaluates the text from the TextInput control and returns a String with the error message. If the returned String is null or empty, no error message will be displayed.

        Style Guide:

        When the function returns a non-empty String, a PseudoClass "error" is added to the TextInput. For styling the error label, which is added as a direct child of the TextInput control, you can use the style-class "error".
        See Also:
        getErrorValidator(), setErrorValidator(Function)
      • getErrorValidator

        public final Function<String,​String> getErrorValidator()
        Gets the value of the property errorValidator.
        Property description:
        Sets an error message that will be displayed below the TextInput control. The Function evaluates the text from the TextInput control and returns a String with the error message. If the returned String is null or empty, no error message will be displayed.

        Style Guide:

        When the function returns a non-empty String, a PseudoClass "error" is added to the TextInput. For styling the error label, which is added as a direct child of the TextInput control, you can use the style-class "error".
      • setErrorValidator

        public final void setErrorValidator​(Function<String,​String> value)
        Sets the value of the property errorValidator.
        Property description:
        Sets an error message that will be displayed below the TextInput control. The Function evaluates the text from the TextInput control and returns a String with the error message. If the returned String is null or empty, no error message will be displayed.

        Style Guide:

        When the function returns a non-empty String, a PseudoClass "error" is added to the TextInput. For styling the error label, which is added as a direct child of the TextInput control, you can use the style-class "error".
      • getTextFormatter

        public final TextFormatter<?> getTextFormatter()
        Gets the value of the property textFormatter.
        Property description:
        The property contains currently attached TextFormatter. Changing the TextFormatter will update the text in the TextInput control based on the new textFormatter.
        Default value:
        null
        Since:
        6.0.2
      • setTextFormatter

        public final void setTextFormatter​(TextFormatter<?> value)
        Sets the value of the property textFormatter.
        Property description:
        The property contains currently attached TextFormatter. Changing the TextFormatter will update the text in the TextInput control based on the new textFormatter.
        Default value:
        null
        Since:
        6.0.2