To my mind GWT is going to take the lead among the web application development tools. So this is the high time to start learning about GWT. Here I describe you how to create your first GWT application in Eclipse 3.4 (Ganymede).
If you have not installed Google plugin and SDK for eclipse please go to this page and follow the instructions.
Create your project
Select File-> New-> Web Application project. Enter "FirstGwtApp" for your project name and "com.ratul.FirstGwtApp" for the package name.

Create GWT entry point
Now you have to create an Entry point class which is similar to the main method in Java.
Right click on the "com.ratul.FirstGwtApp.client" and select New-> Class. Enter "HelloWorld" as the name of the class.

This class must implement the interface "com.google.gwt.core.client.EntryPoint".
So click on the Add button and write "entrypoint" in the choose interface text field.
Select the matching item.

Here is the code of the HelloWorld class
package com.ratul.FirstGwtApp.client;
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.TextBox;
import com.google.gwt.user.client.ui.RootPanel;
public class HelloWorld implements EntryPoint {
@Override
public void onModuleLoad() {
Label label = new Label("Enter your name:");
final TextBox textBox = new TextBox();
Button button = new Button("Click Here");
button.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.alert("Hello "+ textBox.getText());
}
});
RootPanel.get().add(label);
RootPanel.get().add(textBox);
RootPanel.get().add(button);
}
}
Now change the
FirstGwtApp.gwt.xml in package
com.ratul.FirstGwtApp to set the HelloWorld class as the entry point class of your application.
Create a Start HTML page
In the war folder you will find a file, named
FirstGwtApp.html. Between the body tag write the following code
<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" tabindex="-1" style="border: 0pt none ; position: absolute; width: 0pt; height: 0pt;"></iframe>
<h1>Welcome to my first GWT Application</h1>
Configure the web.xml
Go to war-> WEB-INF folder and there you will find a web.xml file. The Google Plug-in created this configuration file and placed a reference to a servlet.
Set the FirstGwtApp.html as the welcome file of your application.
You are only one step away from running your first GWT application.
Run GWT application
To run your application right-click the project and select Run As -> "Web application".
The result will be like this.
Enter your name in the text field and click on the button. Your name will be appeared in the alert window :).