| การพัฒนาโปรแกรม Google Web Toolkit Framework บน Google App Engine |
|
|
|
| Written by Administrator |
| Sunday, 04 October 2009 15:30 |
|
Google Web Toolkit (GWT)เป็น Web Application Framework ที่พัฒนาขึ้นมาโดย Google เพื่อให้นักพัฒนาโปรแกรมสามารถเขียนโปรแกรม Rich Internet Applications (RIAs) แบบ AJAX โดยไม่ต้องเขียนโปรแกรมภาษา JavaScriptแต่สามารถที่จะใช้ภาษา Java ในการพัฒนาได้โดยตรง
แบบฝึกหัดนี้เป็นการนำโปรแกรม NetBeans เพื่อมาพัฒนาโปรแกรมโดยใช้ GWT Frameworks แล้วทดลองพัฒนาโปรแกรมเบื้องต้นเพื่อทดสอบการทำงานบน Google App Engine โดยมีขั้นตอนการพัฒนาโปรแกรมดังนี้
เราสามารถทดสอบโปรแกรมนี้ได้ที่นี http://thaigwtapp.appspot.com/
ผู้สนใจสามารถ ดาวน์โหลดเอกสารที่เป็นไฟล์ PDF ได้ที่นี่ => GWTGoogle.pdf
sourcecode สำหรับไฟล์ MainEntryPoint.java
package org.thaijavadev.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.PasswordTextBox; 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; /** * Main entry point. * * @author Administrator */ 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 TextBox username = new TextBox(); final PasswordTextBox password = new PasswordTextBox(); final Button button = new Button("Logon"); final VerticalPanel panel = new VerticalPanel(); panel.add(new Label("username")); panel.add(username); panel.add(new Label("password")); panel.add(password); panel.add(button); RootPanel.get().add(panel); button.addClickListener(new ClickListener() { public void onClick(Widget sender) { if ("secret".equals(password.getText())) { Window.alert("Welcome " + username.getText()); } else { Window.alert("Invalid authentication"); } } }); } }
Powered by jWarlock jwFacebook Comments |
| Last Updated on Thursday, 29 October 2009 07:47 |











