O'Reilly logo

Ext GWT 2.0 Beginner's Guide by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required