Class CustomTextField

  • All Implemented Interfaces:
    Styleable, EventTarget, Skinnable

    public class CustomTextField
    extends TextField
    A base class for people wanting to customize a TextField to contain nodes inside the text field itself, without being on top of the users typed-in text.

    Screenshot

    The following screenshot is taken from the HelloControlsFX sample application, and shows a normal TextField, with a clearable text field, followed by three CustomTextFields. Note what happens with long text input - it is prevented from going beneath the left and right graphics. Of course, if the keyboard caret moves to the right, the text will become visible, but this is because it will all scroll to the left (as is the case in a normal TextField).

    Screenshot of CustomTextField
    See Also:
    TextFields, CustomPasswordField
    • Constructor Detail

      • CustomTextField

        public CustomTextField()
        Instantiates a default CustomTextField.
    • Method Detail

      • leftProperty

        public final ObjectProperty<Node> leftProperty()
        Returns:
        An ObjectProperty wrapping the Node that is placed on the left ofthe text field.
      • getLeft

        public final Node getLeft()
        Returns:
        the Node that is placed on the left of the text field.
      • setLeft

        public final void setLeft​(Node value)
        Sets the Node that is placed on the left of the text field.
        Parameters:
        value -
      • getRight

        public final Node getRight()
        Returns:
        The Node that is placed on the right of the text field.
      • setRight

        public final void setRight​(Node value)
        Sets the Node that is placed on the right of the text field.
        Parameters:
        value -