title: Adding hint to TextField
body: <p>I want to add a <code>TextField</code> with an integrated hint text, a user prompt, a placeholder until the user enters text. The prompt text disappears when the TextField is focused and re-appears if the TextField loses focus and no text is entered. </p>
  
  <p>I initially thought that this would be a generic feature for Vaadin TextFields but that doesn't seem to be the case. Now I'm looking for a way to implement my own extension of the TextField to add this feature. But I'm stuck.</p>
  
  <p>My question is if anyone here has done this before or instinctively know how it should be done?</p>
  
  <p>This is how far I've come:</p>
  
  <pre><code>package com.smarttrust.m2m.gui.admin;
  
  import com.vaadin.event.FieldEvents.FocusEvent;
  import com.vaadin.event.FieldEvents.FocusListener;
  import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusChangeListener;
  import com.vaadin.ui.TextField;
  
  public class M2MHintTextField extends TextField implements FocusListener    {
  
      private final String hint;
  
      FocusListener listener = new FocusListener() {
  
          @Override
          public void focus(FocusEvent event) {
              // TODO Auto-generated method stub
  
          }
      };
  
      public M2MHintTextField(final String hint)    {
          super(hint);
          this.hint = hint;
          super.addListener(this.listener);
      }
  
      @Override
      public void focus(FocusEvent event) {
          // TODO Auto-generated method stub
  
      }
  }
  </code></pre>