各ウィジェットの詳細はここでは書きませんが、以下の点はマスターしましょう。
Imageウィジェット
URLを参照して画像を表示する
final Image image = new Image(); // Hook up an error handler, so that we can be informed if the image fails // to load. image.addErrorHandler(new ErrorHandler() { public void onError(ErrorEvent event) { lbl.setText("An error occurred while loading."); } }); // Point the image at a real URL. image.setUrl("http://www.google.com/images/logo.gif");
FlexTable
ウェブアプリケーションでは、画面レイアウトにうまくテーブルを利用するのがコツです。GWTでは、FlexTableという使いやすいテーブルのウィジェットがありますので、これを使いこなしましょう。テーブルの上には、テキストの他、ウィジェットも載せることができます。
UIBinder
<g:FlexTable>ui:field="tbl"</g:FlexTable>
Javaコード
@UiField
FlexTable tbl;
tbl.setText(0,0,"あああああ");
tbl.setText(0,1,"いいいいい");