title: Titled frame panel for GWT (using FIELDSET and LEGEND html tags)
body: <p>I'm trying to create a titled border frame in GWT, which results in this:</p>
  
  <p><img src="https://i.stack.imgur.com/fH5DH.png" alt="Legend+Fieldset"></p>
  
  <p>This can be done using HTML fieldset and legend tags, such as</p>
  
  <pre><code>&lt;fieldset&gt; 
      &lt;legend&gt;Connection parameters&lt;/legend&gt;
      ... the rest ...
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>I want to create a custom widget in GWT that implements that. I managed to do that, but the problem is that events that happen inside the widget (button click etc) does not get fired although I have added the handler.</p>
  
  <p>My implementation of the widget is as follows:</p>
  
  <pre><code>public class TitledPanel extends Widget {
  private Element legend;
  private Widget content = null;
  
  public TitledPanel() {
      Element fieldset = DOM.createFieldSet();
      legend = DOM.createLegend();
      DOM.appendChild(fieldset, legend);
      setElement(fieldset);
  }
  
  public TitledPanel(String title) {
      this();
      setTitle(title);
  }
  
  @Override
  public String getTitle() {
      return DOM.getInnerHTML(legend);
  }
  
  @Override
  public void setTitle(String html) {
      DOM.setInnerHTML(legend, html);
  }
  
  public Widget getContent() {
      return content;
  }
  
  public void setContent(Widget content) {
      if (this.content != null) {
          DOM.removeChild(getElement(), this.content.getElement());
      }
  
      this.content = content;
  
      DOM.appendChild(getElement(), content.getElement());
  }
  }
  </code></pre>
  
  <p>Do I need to extend Composite, or need to manually reroute the events, or is there other ways?</p>