Button stream = new Button("Stream!");
stream.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
ExampleStreamServiceAsync ser = (ExampleStreamServiceAsync) GWT.create(ExampleStreamService.class);
StreamingServiceStub stub = (StreamingServiceStub) ser;
stub.setServicePath(GWT.getModuleBaseURL() +
"ExampleStreamService");
ser.getResults(5, "foo",
new StreamServiceCallback<MyClass>() {
public void onReceive(MyClass object) {
add( new Label("Got: " + object.getName()));