package com.java2s.gwt.client;
import com.google.gwt.core.client.*;
import com.google.gwt.user.client.ui.*;
public class GWTClient implements EntryPoint{
public void onModuleLoad() {
final Button button = new Button("Click me");
final Label label = new Label();
button.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
if (label.getText().equals(""))
label.setText("Hello World!");
else
label.setText("");
}
});
RootPanel.get("slot1").add(button);
RootPanel.get("slot2").add(label);
}
}
|