The source code to this applet is located in example1.java . You need a Java-enabled browser to view this applet. Below is a code fragment, taken from the applet shown above, that creates a locale object. For a complete list of codes, refer to the Resources section . Below is a code fragment, taken from the applet shown in Figure 1, which calls some of the Locale class's information methods.
Locale defines several equivalent getDisplay methods that take no arguments.
These methods return values based on the default locale. Suppose you want to dynamically determine which locales are available on a particular platform. These objects represent all of the supported locales. Surprisingly, this method is not part of the Locale class in any JDK version prior to 1.2. Figure 2 shows a Java applet that lists all locales that are available on the current platform.