
Expected duration: 300 minutes
This hands-on lab assumes you have some basic knowledge of, or programming experience with, the following technologies.
Before you begin, you need to install the following software on your
computer. The GWT NetBeans IDE plug-in is included as part of the
hands-on lab zip file. The GWT NetBeans IDE plug-in at this point
is still in alpha quality but it provides a good enough template for
building and running GWT application using NetBeans IDE. More
functionality is being added to the plug-in. This hands-on lab
will be updated when the new plug-in is available.
In this exercise, you are going to
install GWT NetBeans plug-in to the NetBeans IDE.


In this exercise, you are going to build
a simple HelloWorld GWT application using NetBeans. You will also
configure the Google Web Toolkit installation directory to the NetBeans
IDE,
which you have to do only once.
0. Start NetBeans IDE if you have not
done so yet.
1. Create a GWT NetBeans project.

Figure-1.10: Create a new Web application project



Figure-1.12: GWTApplication project

Figure-1.13: First page

Figure-1.14: Display
| /* * MainEntryPoint.java * * Created on May 18, 2007, 5:31 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package org.yournamehere.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; /** * * @author sang */ public class MainEntryPoint implements EntryPoint { /** Creates a new instance of MainEntryPoint */ public MainEntryPoint() { } /** * The entry point method, called automatically by loading a module * that declares an implementing class as an entry-point */ public void onModuleLoad() { final Label label = new Label("Hello, GWT!!!"); final Button button = new Button("Click me!"); button.addClickListener(new ClickListener(){ public void onClick(Widget w) { label.setVisible(!label.isVisible()); } }); RootPanel.get().add(button); RootPanel.get().add(label); } } |
| package org.yournamehere.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; /** * * @author sang */ public class MainEntryPoint implements EntryPoint { /** Creates a new instance of MainEntryPoint */ public MainEntryPoint() { } /** * The entry point method, called automatically by loading a module * that declares an implementing class as an entry-point */ public void onModuleLoad() { final Label label = new Label("Hello, GWT!!!"); final Button button = new Button("Click me!"); button.addClickListener(new ClickListener(){ public void onClick(Widget w) { label.setVisible(!label.isVisible()); } }); Button button2 = new Button("I am the 2nd button. Click me!"); button2.addClickListener(new ClickListener(){ public void onClick(Widget w) { Window.alert("Life is worth living.. with Passion!"); } }); RootPanel.get().add(button); RootPanel.get().add(button2); RootPanel.get().add(label); } } |










In this exercise, you learned how to build and run a HelloWorld GWT application using NetBeans.
In this exercise, you are going to build
and run two sample applications - "Hello"
and "Kitchen Sink" using
NetBeans IDE. Both applications come with the GWT
package. These are the same sample
applications you can run and build using command line shell
commands that come with GWT package. You have to do the Exercise
1 first so that the location of the GWT is correctly configured to the
NetBeans IDE.
In this step, you are going to build and
run "Hello" sample
application using NetBeans. The application is already
provided as "ready-to-build" NetBeans project called GWTHello as
part of hands-on lab
zip file. This application works pretty much the same as the
GWTApplication you built in Exercise 1.
0. Start NetBeans IDE if you have not
done so yet.
1. Open GWTHello NetBeans
project.

Figure-2.10: Open GWTHello NetBeans project

| /* * Copyright 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.gwt.sample.hello.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; public class Hello implements EntryPoint { public void onModuleLoad() { Button b = new Button("Click me", new ClickListener() { public void onClick(Widget sender) { Window.alert("Hello, AJAX"); } }); RootPanel.get().add(b); // Create a new button along with event listener. // The event listener has listener method called onClick(). Button c = new Button("Click me 2", new ClickListener() { public void onClick(Widget sender) { Window.alert("Hello, AJAX2"); } }); RootPanel.get().add(c); } } |

In this step, you are going to build and
run "Kitchen Sink" sample
application using NetBeans and then modify
Buttons.java to add your own
buttons. The application is already
provided as "ready-to-build" NetBeans project called GWTKitchenSink
as part of hands-on lab
zip file.
0. Start NetBeans IDE if you have not
done so yet.
1. Open GWTKitchenSink NetBeans
project.
2. Resolve references (as described above) if you experience
reference problems.
3. Build and run GWTKitchenSink project.



| /* * Copyright 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.gwt.sample.kitchensink.client; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.RadioButton; import com.google.gwt.user.client.ui.VerticalPanel; /** * Demonstrates the various button widgets. */ public class Buttons extends Sink { public static SinkInfo init() { return new SinkInfo("Buttons", "GWT supports all the myriad types of buttons that exist in HTML. " + "Here are a few for your viewing pleasure.") { public Sink createInstance() { return new Buttons(); } }; } // Create button and checkbox objects private Button disabledButton = new Button("Disabled Button"); private CheckBox disabledCheck = new CheckBox("Disabled Check"); private Button normalButton = new Button("Normal Button"); private Button myOwnButton = new Button("My Own Button"); private CheckBox normalCheck = new CheckBox("Normal Check"); // Create a vertical panel private VerticalPanel panel = new VerticalPanel(); // Create radio buttons private RadioButton radio0 = new RadioButton("group0", "Choice 0"); private RadioButton radio1 = new RadioButton("group0", "Choice 1"); private RadioButton radio2 = new RadioButton("group0", "Choice 2 (Disabled)"); private RadioButton radio3 = new RadioButton("group0", "Choice 3"); private RadioButton radio4 = new RadioButton("group0", "Choice 4"); // Constructor of the Buttons class public Buttons() { HorizontalPanel hp; // Create a horizontal panel object and add buttons to it. // Also add the horizontal panel object to the vertical panel. panel.add(hp = new HorizontalPanel()); hp.setSpacing(8); hp.add(normalButton); hp.add(disabledButton); hp.add(myOwnButton); // Create a horizontal panel object and add checkboxes to it. // Also add the horizontal panel object to the vertical panel. panel.add(hp = new HorizontalPanel()); hp.setSpacing(8); hp.add(normalCheck); hp.add(disabledCheck); // Create a horizontal panel object and add radion buttons to it. // Also add the horizontal panel object to the vertical panel. panel.add(hp = new HorizontalPanel()); hp.setSpacing(8); hp.add(radio0); hp.add(radio1); hp.add(radio2); hp.add(radio3); hp.add(radio4); // Set the disabled flags to widget objects disabledButton.setEnabled(false); disabledCheck.setEnabled(false); radio2.setEnabled(false); panel.setSpacing(8); setWidget(panel); } public void onShow() { } } |

| /* * Copyright 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.gwt.sample.kitchensink.client; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.RadioButton; import com.google.gwt.user.client.ui.VerticalPanel; /** * Demonstrates the various button widgets. */ public class Buttons extends Sink { public static SinkInfo init() { return new SinkInfo("Buttons", "GWT supports all the myriad types of buttons that exist in HTML. " + "Here are a few for your viewing pleasure.") { public Sink createInstance() { return new Buttons(); } }; } // Create button and checkbox objects private Button disabledButton = new Button("Disabled Button"); private CheckBox disabledCheck = new CheckBox("Disabled Check"); private Button normalButton = new Button("Normal Button"); private Button myOwnButton = new Button("My Own Button"); private CheckBox normalCheck = new CheckBox("Normal Check"); // Create a vertical panel private VerticalPanel panel = new VerticalPanel(); // Create radio buttons private RadioButton radio0 = new RadioButton("group0", "Choice 0"); private RadioButton radio1 = new RadioButton("group0", "Choice 1"); private RadioButton radio2 = new RadioButton("group0", "Choice 2 (Disabled)"); private RadioButton radio3 = new RadioButton("group0", "Choice 3"); private RadioButton radio4 = new RadioButton("group0", "Choice 4"); // Constructor of the Buttons class public Buttons() { HorizontalPanel hp; // Create a horizontal panel object and add buttons to it. // Also add the horizontal panel object to the vertical panel. panel.add(hp = new HorizontalPanel()); hp.setSpacing(8); hp.add(normalButton); hp.add(disabledButton); hp.add(myOwnButton); // Create a horizontal panel object and add checkboxes to it. // Also add the horizontal panel object to the vertical panel. panel.add(hp = new HorizontalPanel()); hp.setSpacing(8); hp.add(normalCheck); hp.add(disabledCheck); // Create a horizontal panel object and add radion buttons to it. // Also add the horizontal panel object to the vertical panel. panel.add(hp = new HorizontalPanel()); hp.setSpacing(8); hp.add(radio0); hp.add(radio1); hp.add(radio2); hp.add(radio3); hp.add(radio4); // Add my own panel panel.add(hp = new HorizontalPanel()); hp.setSpacing(8); hp.add(normalButton); hp.add(normalCheck); hp.add(radio0); // Set the disabled flags to widget objects disabledButton.setEnabled(false); disabledCheck.setEnabled(false); radio2.setEnabled(false); panel.setSpacing(8); setWidget(panel); } public void onShow() { } } |

| /* * Copyright 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.gwt.sample.kitchensink.client; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.MenuBar; import com.google.gwt.user.client.ui.MenuItem; /** * Demonstrates {@link com.google.gwt.user.client.ui.MenuBar} and * {@link com.google.gwt.user.client.ui.MenuItem}. */ public class Menus extends Sink implements Command { public static SinkInfo init() { return new SinkInfo("Menus", "The GWT <code>MenuBar</code> class makes it easy to build menus, " + "including cascading sub-menus.") { public Sink createInstance() { return new Menus(); } }; } // Create empty master MenuBar object private MenuBar menu = new MenuBar(); public Menus() { // Create a sub-sub-menu bar and add items to the sub-sub-menu bar MenuBar subMenu = new MenuBar(true); subMenu.addItem("<code>Code</code>", true, this); subMenu.addItem("<strike>Strikethrough</strike>", true, this); subMenu.addItem("<u>Underlined</u>", true, this); // Create a new sub-menu bar and add items to it MenuBar menu0 = new MenuBar(true); menu0.addItem("<b>Bold</b>", true, this); menu0.addItem("<i>Italicized</i>", true, this); menu0.addItem("More »", true, subMenu); // Create a new sub-menu bar and add items to it MenuBar menu1 = new MenuBar(true); menu1.addItem("<font color='#FF0000'><b>Apple</b></font>", true, this); menu1.addItem("<font color='#FFFF00'><b>Banana</b></font>", true, this); menu1.addItem("<font color='#FFFFFF'><b>Coconut</b></font>", true, this); menu1.addItem("<font color='#8B4513'><b>Donut</b></font>", true, this); // Create a new sub-menu bar and add items to it MenuBar menu2 = new MenuBar(true); menu2.addItem("Bling", this); menu2.addItem("Ginormous", this); menu2.addItem("<code>w00t!</code>", true, this); // Create a new sub-menu bar and add items to it MenuBar menu3 = new MenuBar(true); menu3.addItem("Life is good!", this); menu3.addItem("Life is OK!", this); menu3.addItem("Life sucks!", this); // Add sub-menu bar's to the master menu bar menu.addItem(new MenuItem("Style", menu0)); menu.addItem(new MenuItem("Fruit", menu1)); menu.addItem(new MenuItem("Term", menu2)); menu.addItem(new MenuItem("Life", menu3)); menu.setWidth("100%"); setWidget(menu); } public void execute() { Window.alert("Thank you for selecting a menu item."); } public void onShow() { } } |

| private static Proto[]
fProto = new Proto[]{ new Proto("Beethoven", new Proto[]{ new Proto("Concertos", new Proto[]{ new Proto("No. 1 - C"), new Proto("No. 2 - B-Flat Major"), new Proto("No. 3 - C Minor"), new Proto("No. 4 - G Major"), new Proto("No. 5 - E-Flat Major"),}), new Proto("Quartets", new Proto[]{ new Proto("Six String Quartets"), new Proto("Three String Quartets"), new Proto("Grosse Fugue for String Quartets"),}), new Proto("Sonatas", new Proto[]{ new Proto("Sonata in A Minor"), new Proto("Sonata in F Major"),}), new Proto("Symphonies", new Proto[]{ new Proto("No. 1 - C Major"), new Proto("No. 2 - D Major"), new Proto("No. 3 - E-Flat Major"), new Proto("No. 4 - B-Flat Major"), new Proto("No. 5 - C Minor"), new Proto("No. 6 - F Major"), new Proto("No. 7 - A Major"), new Proto("No. 8 - F Major"), new Proto("No. 9 - D Minor"),}),}), new Proto("Sang Shin", new Proto[]{ new Proto("Rock and Roll", new Proto[]{ new Proto("Love me tender"), new Proto("Let it Be"), new Proto("Hey Jude"),}), new Proto("Country music", new Proto[]{ new Proto("Lost Highway"), new Proto("Six Days on the Road"), new Proto("Wide Open Road"),}), new Proto("Tango", new Proto[]{ new Proto("Jealousy"), new Proto("Tango of Roses"),}), new Proto("Hip Hop", new Proto[]{ new Proto("No. 1 - C Major"), new Proto("No. 2 - D Major"), new Proto("No. 9 - D Minor"),}),}), new Proto("Brahms", new Proto[]{ new Proto("Concertos", new Proto[]{ new Proto("Violin Concerto"), new Proto("Double Concerto - A Minor"), new Proto("Piano Concerto No. 1 - D Minor"), new Proto("Piano Concerto No. 2 - B-Flat Major"),}), new Proto("Quartets", new Proto[]{ new Proto("Piano Quartet No. 1 - G Minor"), new Proto("Piano Quartet No. 2 - A Major"), new Proto("Piano Quartet No. 3 - C Minor"), new Proto("String Quartet No. 3 - B-Flat Minor"),}), new Proto("Sonatas", new Proto[]{ new Proto("Two Sonatas for Clarinet - F Minor"), new Proto("Two Sonatas for Clarinet - E-Flat Major"),}), new Proto("Symphonies", new Proto[]{ new Proto("No. 1 - C Minor"), new Proto("No. 2 - D Minor"), new Proto("No. 3 - F Major"), new Proto("No. 4 - E Minor"),}),}), new Proto("Mozart", new Proto[]{new Proto("Concertos", new Proto[]{ new Proto("Piano Concerto No. 12"), new Proto("Piano Concerto No. 17"), new Proto("Clarinet Concerto"), new Proto("Violin Concerto No. 5"), new Proto("Violin Concerto No. 4"),}),}),}; |


| .ks-List .ks-SinkItem-selected { background-color: #C3D9FF; } /* -------------- This is my own ------ */ .ks-List .ks-SinkItem-selected-myown { background-color: #EEFFEE; font-weight: bold; font-style: italic; } |
| public void
setSinkSelection(String name) { if (selectedSink != -1) list.getWidget(selectedSink).removeStyleName("ks-SinkItem-selected-myown"); for (int i = 0; i < sinks.size(); ++i) { SinkInfo info = (SinkInfo) sinks.get(i); if (info.getName().equals(name)) { selectedSink = i; list.getWidget(selectedSink).addStyleName("ks-SinkItem-selected-myown"); return; } } } |




| package my.company.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Widget; /** * * @author sang */ public class MainEntryPoint implements EntryPoint { /** Creates a new instance of MainEntryPoint */ public MainEntryPoint() { } /** * A composite of a TextBox and a CheckBox that optionally enables it. */ public static class OptionalTextBox extends Composite implements ClickListener { private TextBox textBox = new TextBox(); private CheckBox checkBox = new CheckBox(); /** * Constructs an OptionalTextBox with the given caption on the check. * * @param caption the caption to be displayed with the check box */ public OptionalTextBox(String caption) { // Place the check above the text box using a vertical panel. VerticalPanel panel = new VerticalPanel(); panel.add(checkBox); panel.add(textBox); // Set the check box's caption, and check it by default. checkBox.setText(caption); checkBox.setChecked(true); checkBox.addClickListener(this); // All composites must call initWidget() in their constructors. initWidget(panel); // Give the overall composite a style name. setStyleName("example-OptionalCheckBox"); } public void onClick(Widget sender) { if (sender == checkBox) { // When the check box is clicked, update the text box's enabled state. textBox.setEnabled(checkBox.isChecked()); } } /** * Sets the caption associated with the check box. * * @param caption the check box's caption */ public void setCaption(String caption) { // Note how we use the use composition of the contained widgets to provide // only the methods that we want to. checkBox.setText(caption); } /** * Gets the caption associated with the check box. * * @return the check box's caption */ public String getCaption() { return checkBox.getText(); } } public void onModuleLoad() { // Create an optional text box and add it to the root panel. OptionalTextBox otb = new OptionalTextBox("Check this to enable me"); RootPanel.get().add(otb); } } |







| package my.company.client; import com.google.gwt.user.client.rpc.RemoteService; // Service interface, which has a single method called myMethod. public interface GWTService extends RemoteService{ public String myMethod(String s); } |
| package my.company.client; import com.google.gwt.user.client.rpc.AsyncCallback; // Asynchronous Service interface. Note that a AsynchCallBack // object needs to be passed as a parameter. public interface GWTServiceAsync { public void myMethod(String s, AsyncCallback callback); } |
| package my.company.server; import com.google.gwt.user.server.rpc.RemoteServiceServlet; import my.company.client.GWTService; // Service implementation, which provides the implementation of // GWTService service interface. public class GWTServiceImpl extends RemoteServiceServlet implements GWTService { public String myMethod(String s) { // Do something interesting with 's' here on the server. return "Server says: " + s; } } |
| package my.company.client; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.ServiceDefTarget; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Widget; public class GWTServiceUsageExample extends VerticalPanel { private Label lblServerReply = new Label(); private TextBox txtUserInput = new TextBox(); private Button btnSend = new Button("Send to server"); public GWTServiceUsageExample() { add(new Label("Input your text: ")); add(txtUserInput); add(btnSend); add(lblServerReply); // Create an asynchronous callback to handle the result. // The AynchCallBack object has to provide implementation // of onSuccess() and onFailure() metods. final AsyncCallback callback = new AsyncCallback() { public void onSuccess(Object result) { lblServerReply.setText((String)result); } public void onFailure(Throwable caught) { lblServerReply.setText("Communication failed"); } }; // Listen for the button clicks. When "Send to server" // button is pressed, the RPC operation occurs. btnSend.addClickListener(new ClickListener(){ public void onClick(Widget w) { // Make remote call. Control flow will continue immediately and later // 'callback' will be invoked when the RPC completes. getService().myMethod(txtUserInput.getText(), callback); } }); } public static GWTServiceAsync getService(){ // Create the client proxy. Note that although you are creating the // service interface proper, you cast the result to the asynchronous // version of // the interface. The cast is always safe because the generated proxy // implements the asynchronous interface automatically. GWTServiceAsync service = (GWTServiceAsync) GWT.create(GWTService.class); // Specify the URL at which our service implementation is running. // Note that the target URL must reside on the same domain and port from // which the host page was served. // ServiceDefTarget endpoint = (ServiceDefTarget) service; String moduleRelativeURL = GWT.getModuleBaseURL() + "gwtservice"; endpoint.setServiceEntryPoint(moduleRelativeURL); return service; } } |
| <?xml version="1.0"
encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <servlet> <servlet-name>GWTService</servlet-name> <servlet-class>my.company.server.GWTServiceImpl</servlet-class> </servlet> <servlet-mapping> <servlet-name>GWTService</servlet-name> <url-pattern>/my.company.Main/gwtservice</url-pattern> </servlet-mapping> <session-config> <session-timeout> 30 </session-timeout> </session-config> <welcome-file-list> <welcome-file> index.jsp </welcome-file> </welcome-file-list> </web-app> |
| package my.company.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; /** * * @author sang */ public class MainEntryPoint implements EntryPoint { /** Creates a new instance of MainEntryPoint */ public MainEntryPoint() { } /** * The entry point method, called automatically by loading a module * that declares an implementing class as an entry-point */ public void onModuleLoad() { final Label label = new Label("Hello, GWT!!!"); final Button button = new Button("Click me!"); // The GWTServiceUsageExample is a VerticalPanel object, the constructor of // which performs RPC operation with the server. GWTServiceUsageExample rpcCallingPanel = new GWTServiceUsageExample(); button.addClickListener(new ClickListener(){ public void onClick(Widget w) { label.setVisible(!label.isVisible()); } }); RootPanel.get().add(button); RootPanel.get().add(label); // Add the GWTServiceUsageExample to the panel // so that you can test it. RootPanel.get().add(rpcCallingPanel); } } |

