﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-心无尘土-随笔分类-JAVA</title><link>http://www.cnitblog.com/Yama/category/2703.html</link><description>一段平凡的日子，一段流逝的岁月</description><language>zh-cn</language><lastBuildDate>Sun, 02 Oct 2011 19:43:58 GMT</lastBuildDate><pubDate>Sun, 02 Oct 2011 19:43:58 GMT</pubDate><ttl>60</ttl><item><title>GWT</title><link>http://www.cnitblog.com/Yama/archive/2007/09/20/33861.html</link><dc:creator>Yama的家</dc:creator><author>Yama的家</author><pubDate>Thu, 20 Sep 2007 15:06:00 GMT</pubDate><guid>http://www.cnitblog.com/Yama/archive/2007/09/20/33861.html</guid><wfw:comment>http://www.cnitblog.com/Yama/comments/33861.html</wfw:comment><comments>http://www.cnitblog.com/Yama/archive/2007/09/20/33861.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Yama/comments/commentRss/33861.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Yama/services/trackbacks/33861.html</trackback:ping><description><![CDATA[GWT<br>看了看google web toolkit,发现还不错，用了几个常用的控件，如果用这个冬冬构建自己小型的网络环境还是相当迅速的。但是，大的项目工程还是。。。有待考察<br>
<ol>
    <li>Google Web Toolkit ArchitectureGWT has four major components:<br>
    a Java-to-JavaScript compiler(GWT Java-to-JavaScript Compiler), <br>
    a "hosted" web browser(GWT Hosted Web Browser),<br>
    and two Java class libraries<br>
    (JRE emulation library&lt;java.lang,java.util&gt; and GWT Web UI class library).<br>
    <br>
    </li>
    <li>Sample with eclipse<br>
    ①GMT_HOMEを設定する。コマンドプロンプトを起動する。<br>
    ②%GWT_HOME%\projectCreator -eclipse HelloGWT -out C:\YangStand\HelloGwtで<br>
    プロジェクトを作成。<br>
    ③%GWT_HOME%\applicationCreator -eclipse HelloGWT -out C:\YangStand\HelloGwt <br>
    org.yang.gwt.sample.widget.client.HelloGwt　（className,フルパッケージ指定）で<br>アプリケーションの雛形を作成。<br>
    <br>
    </li>
    <li>Widget<br>
    ①com.google.gwt.user.client.ui.UIObjectのDirect Known Subclasses: <br>
    MenuItem, TreeItem, Widget<br>
    ②Widget adds support for receiving events from the browser<br>
    <br>
    </li>
    <li>widgetのButtonWidgetサンプル--&gt;&lt;input type="button"&gt;<br>ButtonWidget.html<br><blockquote>
    &lt;html&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;head&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;title&gt;Wrapper HTML for ButtonWidget&lt;/title&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;meta name='gwt:module' content='org.yang.gwt.sample.widget.ButtonWidget'&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/head&gt;<br><br>
    &nbsp;&nbsp;&nbsp; &lt;body&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;script language="javascript" src="gwt.js"&gt;&lt;/script&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;table align=center&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="button1"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt; &lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="button2"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt; &lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="button3"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="label" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt; &lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt; &lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp; &lt;/table&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/body&gt;<br>
    &lt;/html&gt;<br><br></blockquote>
    <br>ButtonWidget.java<br><blockquote>
    package org.yang.gwt.sample.widget.client;<br><br>
    import com.google.gwt.core.client.EntryPoint;<br>
    import com.google.gwt.user.client.Window;<br>
    import com.google.gwt.user.client.ui.Button;<br>
    import com.google.gwt.user.client.ui.ClickListener;<br>
    import com.google.gwt.user.client.ui.Label;<br>
    import com.google.gwt.user.client.ui.RootPanel;<br>
    import com.google.gwt.user.client.ui.Widget;<br><br>
    /**<br>
    &nbsp;* Entry point classes define &lt;code&gt;onModuleLoad()&lt;/code&gt;.<br>
    &nbsp;*/<br>
    public class ButtonWidget implements EntryPoint {<br><br>
    &nbsp; /**<br>
    &nbsp;&nbsp; * This is the entry point method.<br>
    &nbsp;&nbsp; */<br>
    &nbsp; public void onModuleLoad() {<br>
    &nbsp;&nbsp;&nbsp; final Label label = new Label();<br><br>
    &nbsp;&nbsp;&nbsp; final Button button = new Button("Click me(display)");<br>
    &nbsp;&nbsp;&nbsp; button.addClickListener(new ClickListener() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void onClick(Widget sender) {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (label.getText().equals(""))<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label.setText("Hello World!");<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; label.setText("");<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; });<br><br>
    &nbsp;&nbsp;&nbsp; final Button alertbutton = new Button("Jump", new ClickListener() {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void onClick(Widget sender) {<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Window.alert("世界");<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; });<br><br>
    &nbsp;&nbsp;&nbsp; final Button disablebutton = new Button("Disable");<br>
    &nbsp;&nbsp;&nbsp; disablebutton.setEnabled(false);<br><br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; RootPanel.get("button1").add(button);<br>
    &nbsp;&nbsp;&nbsp; RootPanel.get("label").add(label);<br>
    &nbsp;&nbsp;&nbsp; RootPanel.get("button2").add(alertbutton);<br>
    &nbsp;&nbsp;&nbsp; RootPanel.get("button3").add(disablebutton);<br>
    &nbsp; }<br>
    }<br><br></blockquote>
    <br></li>
    <li>widgetのRadioButtonWidgetサンプル--&gt;&lt;input type="radio"&gt;<br>
    %GWT_HOME%\projectCreator -eclipse RadioButtonWidget -out C:\YangStand\RadioButtonWidget<br>
    %GWT_HOME%\applicationCreator -eclipse RadioButtonWidget -out
    C:\YangStand\RadioButtonWidget
    org.yang.gwt.sample.widget.client.RadioButton<br>
    <br>
    RadioButtonWidget.html<br><blockquote>
    &lt;html&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;head&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;title&gt;Wrapper HTML for RadioButtonWidget&lt;/title&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;meta name='gwt:module' content='org.yang.gwt.sample.widget.RadioButtonWidget'&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/head&gt;<br><br>
    &nbsp;&nbsp;&nbsp; &lt;body&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;script language="javascript" src="gwt.js"&gt;&lt;/script&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"&gt;&lt;/iframe&gt;<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;table align=center&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="radio1"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="radio2"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="radio3"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="label" colspan="4" align="center"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/table&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/body&gt;<br>
    &lt;/html&gt;<br><br></blockquote>
    <br>
    RadioButtonWidget.java<br><blockquote>
    package org.yang.gwt.sample.widget.client;<br><br>
    import com.google.gwt.core.client.EntryPoint;<br>
    import com.google.gwt.user.client.ui.ClickListener;<br>
    import com.google.gwt.user.client.ui.Label;<br>
    import com.google.gwt.user.client.ui.RadioButton;<br>
    import com.google.gwt.user.client.ui.RootPanel;<br>
    import com.google.gwt.user.client.ui.Widget;<br><br>
    /**<br>
    &nbsp;* Entry point classes define &lt;code&gt;onModuleLoad()&lt;/code&gt;.<br>
    &nbsp;*/<br>
    public class RadioButtonWidget implements EntryPoint {<br><br>
    &nbsp; public void onModuleLoad() {<br>
    &nbsp;&nbsp;&nbsp; final Label label = new Label();<br><br>
    &nbsp;&nbsp;&nbsp; RadioButton rb1 = new RadioButton("radioGroup");<br>
    &nbsp;&nbsp;&nbsp; rb1.setText("非活性");<br>
    &nbsp;&nbsp;&nbsp; rb1.setEnabled(false);<br>
    &nbsp;&nbsp;&nbsp; rb1.setChecked(true);<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; RadioButton rb2 = new RadioButton("radioGroup", "bar");<br>
    &nbsp;&nbsp;&nbsp; rb2.addClickListener(new ClickListener() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void onClick(Widget sender) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; label.setText("barをセットします");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; });<br><br>
    &nbsp;&nbsp;&nbsp; RadioButton rb3 = new RadioButton("radioGroup", "&lt;strong&gt;baz&lt;/strong&gt;", true);<br>
    &nbsp;&nbsp;&nbsp; rb3.addClickListener(new ClickListener() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void onClick(Widget sender) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; label.setText("bazをセットします");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; });<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; RootPanel.get("radio1").add(rb1);<br>
    &nbsp;&nbsp;&nbsp; RootPanel.get("radio2").add(rb2);<br>
    &nbsp;&nbsp;&nbsp; RootPanel.get("radio3").add(rb3);<br>
    &nbsp;&nbsp;&nbsp; RootPanel.get("label").add(label);<br>
    &nbsp; }<br>
    }<br></blockquote>
    <br>
    </li>
    <li>widgetのCheckBoxWidgetサンプル--&gt;&lt;input type="checkbox"&gt;<br>CheckBoxWidget.html<br><blockquote>
    &lt;html&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;head&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;title&gt;Wrapper HTML for CheckBoxWidget&lt;/title&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;meta name='gwt:module' content='org.yang.gwt.sample.widget.CheckBoxWidget'&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/head&gt;<br><br>
    &nbsp;&nbsp;&nbsp; &lt;body&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;script language="javascript" src="gwt.js"&gt;&lt;/script&gt;<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;table align=left&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="checkBox1"&gt;&lt;/td&gt;&lt;td id="label"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="checkBox2"&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="checkBox3"&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="checkBox4"&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/table&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/body&gt;<br>
    &lt;/html&gt;<br></blockquote>
    <br>
    CheckBoxWidget.java<br><blockquote>
    package org.yang.gwt.sample.widget.client;<br><br>
    import com.google.gwt.core.client.EntryPoint;<br>
    import com.google.gwt.user.client.Window;<br>
    import com.google.gwt.user.client.ui.CheckBox;<br>
    import com.google.gwt.user.client.ui.ClickListener;<br>
    import com.google.gwt.user.client.ui.Label;<br>
    import com.google.gwt.user.client.ui.RootPanel;<br>
    import com.google.gwt.user.client.ui.Widget;<br><br>
    public class CheckBoxWidget implements EntryPoint {<br><br>
    &nbsp;&nbsp;&nbsp; public void onModuleLoad() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; final CheckBox checkBox1 = new CheckBox();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; final CheckBox checkBox2 = new CheckBox("アラート");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; final CheckBox checkBox3 = new CheckBox("&lt;Strong&gt;ラベル英語表示&lt;/Strong&gt;",<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; true);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; final CheckBox checkBox4 = new CheckBox();<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; final Label label = new Label();<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox1.setText("ラベル");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox1.addClickListener(new ClickListener() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void onClick(Widget sender) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (((CheckBox) sender).isChecked()) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (checkBox3.isChecked()) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox1.setText("Label");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; label.setText("Hello world");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox1.setText("ラベル");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; label.setText("hola 世界");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; label.setText("");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox2.addClickListener(new ClickListener() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void onClick(Widget sender) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (((CheckBox) sender).isChecked()) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (checkBox3.isChecked()) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Window.alert("Hello world!");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Window.alert("hola 世界！");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox3.addClickListener(new ClickListener() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void onClick(Widget sender) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (((CheckBox) sender).isChecked()) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox1.setText("label");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox2.setText("click me");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox3.setHTML("&lt;Strong&gt;English label&lt;/Strong&gt;");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox4.setText("disable");&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox1.setText("ラベル");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox2.setText("クリック");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox3.setHTML("&lt;Strong&gt;英語表示&lt;/Strong&gt;");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox4.setText("非活性");&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox4.addClickListener(new ClickListener() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void onClick(Widget sender) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (((CheckBox) sender).isChecked()) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; boolean confirmDis;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (checkBox3.isChecked()) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; confirmDis = Window.confirm("other checkboxes set to disabled?");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; confirmDis = Window.confirm("他のチェックが非活性にする?");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (confirmDis){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox1.setEnabled(false);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox2.setEnabled(false);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox3.setEnabled(false);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox1.setEnabled(true);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox2.setEnabled(true);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkBox3.setEnabled(true);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RootPanel.get("checkBox1").add(checkBox1);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RootPanel.get("checkBox2").add(checkBox2);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RootPanel.get("checkBox3").add(checkBox3);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RootPanel.get("checkBox4").add(checkBox4);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RootPanel.get("label").add(label);<br>
    &nbsp;&nbsp;&nbsp; }<br>
    }<br></blockquote>
    <br>
    </li>
    <li>widgetのTextBoxWidgetサンプル--&gt;&lt;input type="text"&gt;<br>
    TextBoxWidget.html<br><blockquote>&lt;html&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;head&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;title&gt;Wrapper HTML for TextBoxWidget&lt;/title&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;meta name='gwt:module' content='org.yang.gwt.sample.widget.TextBoxWidget'&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/head&gt;<br><br>
    &nbsp;&nbsp;&nbsp; &lt;body&gt;<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;script language="javascript" src="gwt.js"&gt;&lt;/script&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"&gt;&lt;/iframe&gt;<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;table align=center&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;名前&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="inputName"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;パスワード&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="inputPass"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;数字入力&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="inputDigit"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/table&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/body&gt;<br>
    &lt;/html&gt;<br><br></blockquote>
    <br>
    TextBoxWidget.java<br><blockquote>
    package org.yang.gwt.sample.widget.client;<br><br>
    import com.google.gwt.core.client.EntryPoint;<br>
    import com.google.gwt.user.client.DOM;<br>
    import com.google.gwt.user.client.ui.ChangeListener;<br>
    import com.google.gwt.user.client.ui.KeyboardListenerAdapter;<br>
    import com.google.gwt.user.client.ui.PasswordTextBox;<br>
    import com.google.gwt.user.client.ui.RootPanel;<br>
    import com.google.gwt.user.client.ui.TextBox;<br>
    import com.google.gwt.user.client.ui.Widget;<br><br>
    public class TextBoxWidget implements EntryPoint {<br><br>
    &nbsp;&nbsp;&nbsp; public void onModuleLoad() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TextBox name = new TextBox();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PasswordTextBox password = new PasswordTextBox();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TextBox limitInput = new TextBox();<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; limitInput.addKeyboardListener(new KeyboardListenerAdapter() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void onKeyPress(Widget sender, char keyCode, int modifiers) {<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!Character.isDigit(keyCode)) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ((TextBox) sender).cancelKey();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; limitInput.addChangeListener(new ChangeListener() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void onChange(Widget sender) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("input:::" + sender.getElement());<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(DOM.getAttribute(sender.getElement(),<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "value"));<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(((TextBox) sender).getText());<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String str = ((TextBox) sender).getText();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; char[] c = str.toCharArray();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; c.length; i++) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!Character.isDigit(c[i])) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ((TextBox) sender).setText("");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RootPanel.get("inputName").add(name);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RootPanel.get("inputPass").add(password);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RootPanel.get("inputDigit").add(limitInput);<br>
    &nbsp;&nbsp;&nbsp; }<br>
    }<br></blockquote>
    <br></li>
    <li>widgetのTextAreaWidgetサンプル--&gt;&lt;TEXTAREA&gt;<br>
    TextAreaWidget.html<br><blockquote>
    &lt;html&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;head&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;title&gt;Wrapper HTML for TextAreaWidget&lt;/title&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;meta name='gwt:module' content='org.yang.gwt.sample.widget.TextAreaWidget'&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"&gt;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &lt;/head&gt;<br><br>
    &nbsp;&nbsp;&nbsp; &lt;body&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;script language="javascript" src="gwt.js"&gt;&lt;/script&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"&gt;&lt;/iframe&gt;<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;table align=center&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;名前&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="inputName"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td&gt;コメント&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;td id="inputComent"&gt;&lt;/td&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/tr&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/table&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/body&gt;<br>
    &lt;/html&gt;<br><br></blockquote>
    <br>
    TextAreaWidget.java<br><blockquote>
    package org.yang.gwt.sample.widget.client;<br><br>
    import com.google.gwt.core.client.EntryPoint;<br>
    import com.google.gwt.user.client.DOM;<br>
    import com.google.gwt.user.client.Window;<br>
    import com.google.gwt.user.client.ui.ChangeListener;<br>
    import com.google.gwt.user.client.ui.RootPanel;<br>
    import com.google.gwt.user.client.ui.TextArea;<br>
    import com.google.gwt.user.client.ui.TextBox;<br>
    import com.google.gwt.user.client.ui.Widget;<br><br>
    public class TextAreaWidget implements EntryPoint {<br><br>
    &nbsp;&nbsp;&nbsp; public void onModuleLoad() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TextBox tb = new TextBox();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TextArea ta = new TextArea();<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ta.setCharacterWidth(80);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ta.setVisibleLines(10);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ta.addChangeListener(new ChangeListener() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public void onChange(Widget sender) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("input:::" + sender.getElement());<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(DOM.getAttribute(sender.getElement(),<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "value"));<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(((TextArea) sender).getText());<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int charCount = ((TextArea) sender).getCursorPos();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(charCount);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Window.alert(charCount + "文字入力しました");<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String str = ((TextArea) sender).getText();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(str);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Window.alert(str);<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });<br><br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RootPanel.get("inputName").add(tb);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RootPanel.get("inputComent").add(ta);<br>
    &nbsp;&nbsp;&nbsp; }<br>
    }<br><br></blockquote>
    <br></li>
</ol>
<br><br><br><br><br><br>備考：<br>バッチファイルで一発生成する<br><strong>call</strong> %GWT_HOME%\projectCreator -eclipse CheckBoxWidget -out C:\YangStand\CheckBoxWidget<br>call
%GWT_HOME%\applicationCreator -eclipse CheckBoxWidget -out
C:\YangStand\CheckBoxWidget
org.yang.gwt.sample.widget.client.CheckBoxWidget<br>call %GWT_HOME%\projectCreator -eclipse TextBoxWidget -out C:\YangStand\TextBoxWidget<br>call
%GWT_HOME%\applicationCreator -eclipse TextBoxWidget -out
C:\YangStand\TextBoxWidget
org.yang.gwt.sample.widget.client.TextBoxWidget<br>&#8230;<br><br>
<br><img src ="http://www.cnitblog.com/Yama/aggbug/33861.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Yama/" target="_blank">Yama的家</a> 2007-09-20 23:06 <a href="http://www.cnitblog.com/Yama/archive/2007/09/20/33861.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse开始学java 3.运算符和条件式</title><link>http://www.cnitblog.com/Yama/archive/2006/05/11/10364.html</link><dc:creator>Yama的家</dc:creator><author>Yama的家</author><pubDate>Thu, 11 May 2006 08:31:00 GMT</pubDate><guid>http://www.cnitblog.com/Yama/archive/2006/05/11/10364.html</guid><wfw:comment>http://www.cnitblog.com/Yama/comments/10364.html</wfw:comment><comments>http://www.cnitblog.com/Yama/archive/2006/05/11/10364.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Yama/comments/commentRss/10364.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Yama/services/trackbacks/10364.html</trackback:ping><description><![CDATA[运算符<br /><br />    说起运算符，首先当然是[是人都知道]的算术运算符：加減乗除（＋、－、＊、/），然后是逻辑运算符，也就是日文的論理演算子。<br />    &amp;&amp;　かつ　論理積<br />    ||　または　論理和<br /><br />    我们可以看看下面的例子来体会一下<br />        boolean bt = true;<br />        boolean bf = false;<br />        System.out.println(bt &amp;&amp; bt);<br />        System.out.println(bt &amp;&amp; bf);<br />        System.out.println(bf &amp;&amp; bf);<br />        System.out.println(bt || bt);<br />        System.out.println(bt || bf);<br />        System.out.println(bf || bf);<br /><br />    输出为<br />         true<br />        false<br />        false<br />        true<br />        true<br />        false<br /><br /><br />条件式(するかしないか判断基準)<br /><br /><img src ="http://www.cnitblog.com/Yama/aggbug/10364.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Yama/" target="_blank">Yama的家</a> 2006-05-11 16:31 <a href="http://www.cnitblog.com/Yama/archive/2006/05/11/10364.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse开始学java 2.基本类型说明</title><link>http://www.cnitblog.com/Yama/archive/2006/05/10/10309.html</link><dc:creator>Yama的家</dc:creator><author>Yama的家</author><pubDate>Wed, 10 May 2006 07:28:00 GMT</pubDate><guid>http://www.cnitblog.com/Yama/archive/2006/05/10/10309.html</guid><wfw:comment>http://www.cnitblog.com/Yama/comments/10309.html</wfw:comment><comments>http://www.cnitblog.com/Yama/archive/2006/05/10/10309.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Yama/comments/commentRss/10309.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Yama/services/trackbacks/10309.html</trackback:ping><description><![CDATA[日文简介<br />    変数の宣言をするときには、メモリ領域をどのように使用するかを決めるための<b>型</b>と、そのメモリ領域の読み書きをするときに使う<b>変数名</b>（正確には識別子）とを指定します。 型にはプログラマが拡張できない<b>基本型（プリミティブ型）</b>と、プログラマが拡張できる<b>参照型（リファレンス型）</b>があります.<br /><br />中文简介<br />    对于编程来说,首先要搞明白的就是你现在使用语言可以用到那些类型.也就是说什么样的数据你可以去控制去使用.<br />    所以在声明一个变量的时候,必须注意两点,首先是变量的类型(用来决定在内存里面如何保存),其次是变量名(不知道名字当然就不能使用哦）。<br />    类型分为程序语言本来就有的类型和可以自己构造扩充的2大类。<br /><br />说到这里，突然想起来Bruce eckel同志说过的一段话<br /><font>    Like any human language, Java provides a way to express concepts.<br />    If successful, 
this medium of expression will be significantly easier and more flexible than 
the alternatives as problems grow larger and more complex</font><br />    怎么说吧，学习一种语言不要机械的去记忆，更多的应该是思考。就如我们现在说的语言类型，不管是java,还是C,vb等等都需要基本类型，你可以把认为是我们接触这个世界的时候就拥有的处理事务的一种能力，有了这个我们才能够对事物来分门别类的使用。而未知的世界很多，为了不断的发展，我们就需要能够扩充的类型。<br />    正如刚刚那段话，if successful你可以让世界变得简单，但是如果没有本质的明白，你会觉得很难。<br />    但是如何让成功地使用java这种语言呢<font>，首先你需要在不断的学习中建立解决各种问题的基本模型。其次你要能够在以后迅速的把问题转化成你有的模型去处理。</font><br /><br />废话打住，言归正传！！！<br />下面主要介绍几种主要的基本类型，并且举例说明。<br />1.boolean <br />    論理型 布尔型<br />    简单说就是真和假(true,false)<br />2.int<br />    整数型 整型<br />3.double<br />    実数型<br /><br />我们来把他们变成程序看一看<br />还是上一讲里面的hello world.我们在打印helloworld的语句后面继续加上<br />        boolean a;<br />        a = true;<br />        System.out.println(a);<br />        a = false;<br />        System.out.println(a);<br />        <br />        int b;<br />        b = 100;<br />        System.out.println(b);<br />        <br />        double c;<br />        c = 10000000;<br />        System.out.println(c);<br /><br />用来分别定义这3种类型的变量并且赋给他们相应的值<br />然后打印到控制台<br />让我们看看输出<br />true<br />false<br />100<br />1.0E7<br />就是这么简单把！！！！！<br /><br />当然如果我们只能够这样，那么编程就没有用处可言拉<br />下面让我们看看通过表达式来运算，从而走入用计算机开始解决复杂问题的道路。<br />（记住，计算机仅仅是一个工具，我们的目的是简单的使用计算机去完成复杂任务）<br /><br /><br /><br /><br /><br /><img src ="http://www.cnitblog.com/Yama/aggbug/10309.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Yama/" target="_blank">Yama的家</a> 2006-05-10 15:28 <a href="http://www.cnitblog.com/Yama/archive/2006/05/10/10309.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse开始学java 1.helloworld</title><link>http://www.cnitblog.com/Yama/archive/2006/05/10/10300.html</link><dc:creator>Yama的家</dc:creator><author>Yama的家</author><pubDate>Wed, 10 May 2006 06:10:00 GMT</pubDate><guid>http://www.cnitblog.com/Yama/archive/2006/05/10/10300.html</guid><wfw:comment>http://www.cnitblog.com/Yama/comments/10300.html</wfw:comment><comments>http://www.cnitblog.com/Yama/archive/2006/05/10/10300.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnitblog.com/Yama/comments/commentRss/10300.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Yama/services/trackbacks/10300.html</trackback:ping><description><![CDATA[朋友要学习java,所以决定帮她整理一套最简单实用的java学习资料来。<br /><br />Eclipse<br />1。下载安装<br />   首先去Eclipse本家 http://www.eclipse.org/downloads/ 去下载开发用的SDK.<br />    我下载的时候是3.1.2版.下载后解压就能够直接用了，绿色软件阿！！！<br /><br />2。第一个小程序<br />    当然开始编程都是要hello world的。<br /><br />★Project做成阶段<br />    a. File-&gt;New-&gt;Project弹出new project窗口<br />    b.选择Java文件夹里面的Java Project然后next<br />    c.Project Name里面填上Helloworld然后直接Finish<br />    d.这个时候Package Explorer的窗口里面就可以看见刚刚建立的HelloWorld了<br /><br />    备注：如果看不见Package Explorer窗口或者不小心关掉了，不要急，你可以在Window-&gt;Show view里面打开它<br /><br />    豆知识：<br />        <font size="2">
プロジェクトとは、企画とか計画という意味です。普通は、会社で新しいプログラムを開発するときには、プロジェクトを組んでチームのメンバーを集めること
になります。そういったチーム開発に対応できるようにということから、Eclipseでは[プロジェクト]単位でプログラムを開発するようになっていま
す。Eclipseの[プロジェクト]では、開発するプログラムに適した環境設定をしたり、必要なファイルをまとめて管理したりできます。例えば、プログ
ラムのソースコードを記述したファイルや、それをコンパイルすると出来上がるクラスファイルをどのフォルダに置いておくかの設定ができたり、[プロジェク
ト]からソースコードを簡単に参照できたりします。<br /><br /><br /></font>★类做成阶段<br />    一个Project就是一个系统，里面有很多东东互相作用来处理复杂的事务。这些咚咚就是类。当然HelloWorld没有这么复杂，我们只用建立一个类就可以了。<br />    a.选中窗口中的HelloWorld然后右键，New-&gt;Class<br />    b.Name还是填上HelloWorld<br />    c.「public static void main(String[] args)」的CheckBox选上<br />    d.Finish<br />    e.刚刚的packageExplore窗口里面出现了刚刚做的类，并且主编辑窗口里面自动生成的最简单的程序结构<br />    f.编辑Helloworld.java，加入打印语句 System.out.println("Hello World");<br /><br />★编译<br />    其实保存和编译是在一起，按下Ctrl+S就可以。当然也可以用file-&gt;save<br /><br />    备注：如果有错误，错误地方会有红色的小波浪线，并且行前会有叉叉，还有就是你可以通过下面的Problems窗口来看关于各种错误地描述以便于定位和改错。<br /><br />★运行<br />    a.选择Run-&gt;Run<br />    b.在弹出的Run窗口的左边Configurations里面双击JavaApplication<br />    c.我们看见Helloworld出现在JavaApplication的下面<br />    d.然后点击下面的Run<br />    e.这时候我们可以看见下面的窗口自动切换到了Console(这就是想要出力的控制平台),并且最下面打出来我们想要出力的字符串。<br /><br />Ok,<br />welcome to JavaWorld,Dear<br /><img src ="http://www.cnitblog.com/Yama/aggbug/10300.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Yama/" target="_blank">Yama的家</a> 2006-05-10 14:10 <a href="http://www.cnitblog.com/Yama/archive/2006/05/10/10300.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>