Class ClearableTextField

java.lang.Object
com.codename1.ui.Component
com.codename1.ui.Container
com.codename1.components.ClearableTextField
All Implemented Interfaces:
Animation, Editable, StyleListener, Iterable<Component>

public final class ClearableTextField extends Container
Wraps a text field so it will have an X to clear its content on the right hand side
  • Method Details

    • wrap

      public static ClearableTextField wrap(TextArea tf, float iconSize)

      Wraps the given text field with a UI that will allow us to clear it

      Parameters
      • tf: the text field

      • iconSize: size in millimeters for the clear icon, -1 for default size

      Returns

      a Container that should be added to the UI instead of the actual text field

    • wrap

      public static ClearableTextField wrap(TextArea tf)

      Wraps the given text field with a UI that will allow us to clear it

      Parameters
      • tf: the text field
      Returns

      a Container that should be added to the UI instead of the actual text field