Class FloatingHint

All Implemented Interfaces:
Animation, Editable, StyleListener, Iterable<Component>

public class FloatingHint extends Container

A floating hint is similar to a text field with a hint. However, when the text field has text in it the hint appears above the text field instead including an animation when focus hits the text field see Googles take on this.

Form hi = new Form("Floating Hint", BoxLayout.y());
TextField first = new TextField("", "First Field");
TextField second = new TextField("", "Second Field");
hi.add(new FloatingHint(first)).
        add(new FloatingHint(second)).
        add(new Button("Go"));
hi.show();

The animation effect

  • Constructor Details

    • FloatingHint

      public FloatingHint(TextArea tf)

      Wraps a text field in a floating hint

      Parameters
      • tf: the text field
  • Method Details

    • initComponent

      protected void initComponent()
      Description copied from class: Component
      Allows subclasses to bind functionality that relies on fully initialized and "ready for action" component state
      Overrides:
      initComponent in class Component