Академический Документы
Профессиональный Документы
Культура Документы
Definitions
GWT
GWT is a toolkit that allows developers to create rich and high performance web applications using
JAVA. GWT translate the JAVA Code to a Javascript or AJAX web code.
GWTDesigner
GWT Designer is an easy GUI designer that makes developers to rapidly create GWT GUI applications
without writing code just with display simple forms.
Recipes
Recipe1: First Application: HelloWorld
In this cookbook, the Eclipse 3.5 will be used. First, we must downloading and installing GWT
with all its supports. From the menu Help/Install New Software
Past this lien http://dl.google.com/eclipse/plugin/3.5 and select the two items and click
Next. Once the gwt plugin has been installed, Google Plugin for Eclipse and GWT Designer
will be automatically installed.
Create a new project from File/New/JAVA Project. We must select at the Libraries : Add
External Jars and we choose “gwt-user.jar” downloaded here: http://google-web-
toolkit.googlecode.com/files/gwt-2.1.0.zip
Right Click at the Project and choose Google Web Toolkit/Convert Project into GWT project
Right Click at the Project and choose Google Web Toolkit/GWT Module
You can explore the project and inspect the ImageViewer.java. It will be converted to an
HTML page
To running Project. Right Click at the project and choose Run As GWT Application. It will
show you a GWT SDK for compiling the code (hosted-mode approach)
And that's all, the application has been deployed and is now running. You can run it at your
default web browser by clicking on “Launch Default Browser” at the GWT SDK.
Recipe 2: GWT features
Step 1 : first page generated
Panel:
Each window must contain some panel where we can put it in some widgets.
Add a panel:
menuBar.setVisible(true);
menuBar.setVisible(false);
Checkbox:
To creat a checkbox :
checkBox.setSize("158px", "34px");
TextBox:
To creat a TextBox :
textBox_1.setText("MyText");
Add a TextArea:
Radio Button
List Box
A widget that presents a list of choices to the user as a list box.
listBox.addItem("MyItem");
Label
Agenda
Add a calendar:
DatePicker datePicker = new DatePicker();
File Upload
Add a link
A widget that serves as an hyperlink. That is, it is a link to another state of the running
application. It should behave exactly like Hyperlink.
Add an image:
image.setSize("190px", "100px");
Menu
A standard menu bar widget. A menu bar can contain any number of menu items, each of
which can either fire a Command or open a cascaded menu bar.