In this post we will set up Netbeans to support a GWT Project using the gwt4nb plugin. Note that there is also the Google plugin for Eclipse.

First off, download and install the gwt4nb plugin.

In Netbeans, create a new Java Web –> Web Application. Name your application and hit Next until you get to the Frameworks tab. If you have successfully installed the gwt4nb plugin you should see Google Web Toolkit listed. Select the Google Web Toolkit framework. Then, if you haven’t already, download the GWT SDK. Next, browse to the GWT SDK installation folder. Name your GWT module and hit Finish.

The plug-in will create a gwt.xml file which references the GWT entry point implementation class.

For example, if I used the module name com.codenes then I would see the file codenes.gwt.xml created in the com package under Source Packages. The entry point implementation class reference would read as:

<entry-point class=”com.client.codenesEntryPoint”/>

We can locate the entry point implementation class within the newly created com.client package. Inspecting this class, we can see the entry point method onModuleLoad() which is where we will be adding our own code later. Inside the method we can see a button and a label are being created and added to the RootPanel.

Run the project, your browser should launch and the button “Click me!” and the text “Hello, GWT!!!” should be visible.

:)