0

アプリケーションで TimeZone 設定を提供したいので、smart Gwt を使用してブラウザからタイム ゾーンを取得する必要があります。タイムゾーンの取得方法を教えてください。実際にsmart gwtアプリでJavaコーディングを以下のように書いてみましたが、

String timezones[]=java.util.TimeZone.getAvailableIDs();

for(int i=0;i<(timezones.length)-1;i++)
{

System.out.println(timezones[i]);

}

しかし、うまくいかず、次のように例外をスローしています。

  1. [ERROR] [timezoneproject] Line 32: No source code is available for type java.util.TimeZone; did you forget to inherit a required module

  2. [ERROR] [timezoneproject] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly

どうすればこれを解決できますか?

4

3 に答える 3

2

GWT は TimeZone をサポートしています。

TimeZones のリストについては、com.google.gwt.i18n.client.TimeZoneConstants インターフェースを参照してください。

ここで見つけることができます

また、ここでテストプログラムを見つけてください

GWT でタイムゾーンを作成するには

final TimeZoneConstants timeZoneConstants = GWT.create(TimeZoneConstants.class);

TimeZone usPacific = TimeZone.createTimeZone(
        TimeZoneInfo.buildTimeZoneData(timeZoneConstants.americaLosAngeles()));
于 2012-06-11T07:10:37.083 に答える
0

TimeZone は、GWT エミュレートされた JRE の一部ではありません。したがって、使用することはできません。

このリンクを参照してください: https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation#Package_java_util

于 2012-06-06T09:09:36.950 に答える