Previous | Next | Trail Map | Writing Java Programs | Table of Contents


Writing Global Programs

The Internet is a large and growing network of computers from all over the world. The Internet provides an unprecedented ability to communicate instantly (well, as instantly as is possible with a PC, a 14.4 modem, and a woefully overloaded Internet) with people from around the globe at any time. With this ability comes certain responsibilities, such as enabling people to use software in their natural language and according to their customs.

The 1.1 release of the JDK has several new features to help you write global programs. That is, programs that tailor themselves to the user's customs and language. The applet running below, called AroundTheWorld, uses these new features of the JDK to display information about various places in the world in a way that is appropriate for users in that area.


Note: The internationalization features documented in this lesson were added to the JDK for its 1.1 release. Thus the AroundTheWorld applet will work only in browsers or viewers that support JDK 1.1. If your browser does not support JDK 1.1 applets, you can use the appletviewer program that ships with JDK 1.1 to run the program.

Since you can't run the applet, here's a picture of it:

What Is a Global Program?

The AroundTheWorld applet uses features of the JDK 1.1 to present information about different areas of the world in the most natural way for that area. The AroundTheWorld applet illustrates the components and design features of a global program.

Exploring "AroundTheWorld"

First, you should get familiar with the source code to the AroundTheWorld applet. Later, we'll walk through the source code and investigate its global features and how it uses the JDK 1.1 to implement those features.

What Are Locales and How Do I Use Them?

The JDK 1.1 provides a Locale class that represents a specific geographic or political region. A Locale object is just an identifier--it contains information about the locale (such as its language and country) but does not contain any data for the locale.

Managing Locale-Sensitive Data

A global program isolates locale-sensitive data and localizes them. That is, a global program isolates locale-sensitive data into localized ResourceBundles.

Formatting Dates, Numbers, and Messages

Dates and numbers are locale-sensitive--different people format dates and numbers differently whether it's the order in which the date elements are listed or the symbol used as the decimal point. In addition, instructions, errors, and other messages that the user sees need to be formatted in a flexible and global manner. The JDK 1.1 provides a rich set of date, number, and message formatters.

Character Encoding and Conversion

[PENDING: ... ]

Collation and Text Boundaries

[PENDING: ... ]

Unicode Handling "Stuff"

[PENDING: ... ]

Internationalizing an Existing Program--Step By Step

This section steps you through the process of internationalizing an existing program. The applet to be treated is the WordMatch applet originally written by Pat Chan.

[PENDING: here's a list of some more information to include in this lesson:

]


Previous | Next | Trail Map | Writing Java Programs | Table of Contents