Extends Composite To Create Custom Component : Composite « GWT « Java






Extends Composite To Create Custom Component


package com.java2s.gwt.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Composite;

public class GWTClient implements EntryPoint {

  public void onModuleLoad() {
    MyComponent com = new MyComponent();

    RootPanel.get().add(com);
  }
}

class MyComponent extends Composite {
  private Button dialogButton = new Button("Show Dialog");
  private Button popupButton = new Button("Show Popup");
  
  public MyComponent(){
    
    VerticalPanel panel = new VerticalPanel();
    panel.add(popupButton);
    panel.add(dialogButton);

    panel.setSpacing(8);    
    initWidget(panel);
  }
  
  
}


           
       








GWT-extendsCompositeToCreateCustomComponent.zip( 2 k)

Related examples in the same category

1.Create Custom Panel Based On Composite