O'Reilly logo

Java™ How to Program, Seventh Edition by P. J. Deitel - Deitel & Associates, Inc., H. M. Deitel - Deitel & Associates, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

I.6. Using Unicode

Numerous programming languages (e.g., C, Java, JavaScript, Perl, Visual Basic) provide some level of support for the Unicode Standard. The application shown in Fig. I.3Fig. I.4 prints the text “Welcome to Unicode!” in eight different languages: English, Russian, French, German, Japanese, Portuguese, Spanish and Traditional Chinese.

Figure I.3. Java application that uses Unicode encoding
 1  // Fig. F.3: UnicodeJFrame.java
 2  // Demonstrating how to use Unicode in Java programs.
 3  import java.awt.GridLayout;
 4  import javax.swing.JFrame;
 5  import javax.swing.JLabel;
 6
 7  public class UnicodeJFrame extends JFrame
 8  {
 9     // constructor creates JLabels to display Unicode
10     public UnicodeJFrame()
11     {
12        super( "Demonstrating Unicode" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required