tags:

views:

25

answers:

1

i have following code

package e.vogella.gwt.helloworld;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;


public class HelloGwt  implements EntryPoint{

    @Override
    public void onModuleLoad(){
        Label label=new Label("hello world");
        Button button=new Button("say something");
        button.addClickHandler(new ClickHandler(){
     @Override
     public void onClick (ClickEvent event){
         Window.alert("hello again");

            }



        });

    RootPanel.get().add(label);
    RootPanel.get().add(button);



    }
}

how make such that it gives me output on screen when i click run does not show me output

A: 

You need to compile this code to JavaScript using the GWT compiler, and run the code in a browser, then click the button. I suggest using Development Mode to step through your code with a debugger, but first I suggest reading up a little more about GWT.

Jason Hall