Gwt-radiobutton-widget
GWT-RadioButtonウィジェット
前書き
クラス宣言
以下は com.google.gwt.user.client.ui.RadioButton クラスの宣言です-
CSSスタイルルール
次のデフォルトのCSSスタイルルールがすべてのRadioButtonウィジェットに適用されます。 要件に応じて上書きできます。
クラスコンストラクター
Sr.No. | Constructor & Description |
---|---|
1 |
RadioButton(java.lang.String name) 特定のグループ名に関連付けられた新しいラジオを作成します。 |
2 |
RadioButton(java.lang.String name,java.lang.String label) 特定のグループに関連付けられ、指定されたHTMLラベルで初期化された新しいラジオを作成します。 |
3 |
RadioButton(java.lang.String name,java.lang.String label, boolean asHTML) 特定のグループに関連付けられ、指定されたラベルで初期化される新しいラジオボタンを作成します(オプションでHTMLとして処理されます)。 |
クラスメソッド
Sr.No. | Function name & Description |
---|---|
1 |
void setName(java.lang.String name) このラジオボタンのグループ名を変更します。 |
継承されるメソッド
このクラスは、次のクラスからメソッドを継承します-
- com.google.gwt.user.client.ui.UIObject
- com.google.gwt.user.client.ui.Widget
- com.google.gwt.user.client.ui.FocusWidget
- com.google.gwt.user.client.ui.CheckBox
- java.lang.Object
RadioButtonウィジェットの例
この例では、GWTでRadioButtonウィジェットの使用方法を示す簡単な手順を紹介します。 次の手順に従って、_GWTで作成したGWTアプリケーションを更新します-アプリケーションの作成_の章-
Step | Description |
---|---|
1 | Create a project with a name HelloWorld under a package com.finddevguides as explained in the GWT - Create Application chapter. |
2 | Modify HelloWorld.gwt.xml, HelloWorld.css, HelloWorldl and HelloWorld.java as explained below. Keep rest of the files unchanged. |
3 | Compile and run the application to verify the result of the implemented logic. |
以下は、変更されたモジュール記述子 src/com.finddevguides/HelloWorld.gwt.xml の内容です。
以下は、変更されたスタイルシートファイル war/HelloWorld.css の内容です。
以下は、変更されたHTMLホストファイル war/HelloWorldl の内容です。
RadioButtonウィジェットの使用方法を示すJavaファイル src/com.finddevguides/HelloWorld.java の内容を以下に示します。
すべての変更が完了したら、link:/gwt/gwt_create_application [GWT-アプリケーションの作成]の章で行ったように、アプリケーションをコンパイルして開発モードで実行します。 すべてがあなたのアプリケーションでうまくいけば、これは次の結果を生成します-