Time for action - creating the ItemPanel

  1. Create a new class in the client.components package named ItemPanel that extends ContentPanel:
    public class ItemPanel extends ContentPanel {
    
  2. Create a new instance of the GWT HTML widget:
    private final HTML html = new HTML();
    
  3. Override the onRender method, setting the title to Item and adding the HTML widget to the underlying ContentPanel:
    @Override
    protected void onRender(Element parent, int index) {
    super.onRender(parent, index);
    setHeading("Item");
    add(html);
    }
    
  4. We want the ContentPanel to be filled with the HTML widget, so set the layout of the underlying ContentPanel to FitLayout. We also want the HTML widget to inherit a CSS style, so set the style of the html to item:
    @Override protected void onRender(Element ...

Get Ext GWT 2.0 Beginner's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.