2009年 4月 01日 水曜日
JavaFX: Display localized Screen on runtime
This is English version of this blog
Sample for Runtime localization (Web Start, use signed jar)
If you see the source code, you can find that this example is using the Locale.setDefault Java class method, like change the default locale and reload the localized strings from .fxproperties.
The clock in botton of the screen is created with refering to Building a JavaFX Application Using NetBeans IDE .
However, to display the time, use extended formatter to display localized time format.
LocalizedDate = "{%tEc now}";
Also, this sample has the round image animation (?), which is I've wanted to create from before. When you click the language button, world map will move to center the city where represent specified language and Timezone.
- English : Los Angeles
- Japanese: Tokyo
- Simplified Chinese: Shanghai (Because timezone need to specify Shanghai (not Beijing) in Java)
- Korean: Seoul
- Brazilian Portuguese: Sao Paulo
This is simply implemented with 3 lined world map, and display only center one and move 3 maps together to left or right.
Displayed in English. Then, click Japanese (日本語) button,
Chnage to Japanese.
Posted at 05:28午後 4 01, 2009 by kenji in JavaFX の素人 |