views:

160

answers:

2

A Java Swing applet needs to display its MenuItems in Chinese or English, depending on how a user has set their system preferences.

Has anybody seen compilable examples showing how to do this?

I've seen a few articles on the subject of i18n and Java/Swing (for example, this one), but so far I haven't found anything specific to the subjects of Swing, Applets, and MenuItems. Being completely new to i18n, I would prefer a working example to help me get up to speed quickly.

+1  A: 

After working through the example you've already found, I'd recommend reading http://www.chinesecomputing.com/programming/java.html

CPerkins
+1  A: 

You should start with the Java Internationalization tutorial.

Basically, you put all your text strings in to external ResourceBundles which have locale suffixes, and you can load the appropriate one depending on the user's current locale. This means the menu item labels are not hard-coded into the source. It all works surprisingly easy actually, as the ResourceBundle API does all the hard work for you.

Other resources are here.

arooaroo