利用GWT控制创建一个表

package com.java2s.gwt.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.Grid;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

public class GWTClient implements EntryPoint{
   Label nameLabel = new Label("Name:");
   TextBox nameBox = new TextBox();
   Label addrLabel = new Label("Address:");
   TextBox addrBox = new TextBox();
   Label phoneLabel = new Label("Phone number:");
   TextBox phoneBox = new TextBox();
   Button button = new Button("Submit");

   Grid grid = new Grid(4, 2);
   
   public void onModuleLoad() {
      grid.setWidget(0, 0, nameLabel);
      grid.setWidget(0, 1, nameBox);
      grid.setWidget(1, 0, addrLabel);
      grid.setWidget(1, 1, addrBox);
      grid.setWidget(2, 0, phoneLabel);
      grid.setWidget(2, 1, phoneBox);
      grid.setWidget(3, 1, button);
      RootPanel.get().add(grid);
      
      button.addClickListener(new ClickListener() {
         public void onClick(Widget sender) {
            grid.setVisible(false);
            RootPanel.get().add(
                  new Label("Thanks for your submission."));
            Window.alert("Submit name=" + nameBox.getText()
                  + "\naddress=" + addrBox.getText() + "\nphone="
                  + phoneBox.getText());
         }
      });
   }
}

 

1、复习触发事件。

2、研究RPC,用GWT做一个Ajax的小例子。

3、对布局、CSS样式的添加、所有表单域的写法与提交。

4、做一个全面一点的例子上传到我的Google App Engine 应用上。

……

 

不断学习……

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值