Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4172572

Java cannot draw Euro symbol in a window.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.1.7, 1.2.0
    • client-libs

      Java apps cannot draw Euro symbol in a windows because there is no
      font properties file specifying X11 fonts with iso8859-15 encodings.

      This simple test should display the Euro symbol in a TextArea and a Label.
      Use "setenv LANG en_GB.ISO8859-15" on Solaris 2.7.

      (For later builds of jdk1.2, watch out for libc bug 4171977, nl_langinfo
      is broken causing file.encoding to be wrong.)

      import java.awt.Frame;
      import java.awt.Label;
      import java.awt.TextArea;

      public class SimpleEuroTest extends Frame {

          private TextArea textArea;
          private Label label;
          public static final char EURO = '\u20ac';

          private static final String testString = "EURO(" + EURO + ")";

          /**
           * Create a Frame containing a single TextArea displaying the given string.
           */
          private SimpleEuroTest() {
              add(new TextArea(testString, 20, 60));
              add(new Label(testString), "South");
              pack();
              show();
          }

          public static void main(String[] args) {
              new SimpleEuroTest();
          }

            aliusunw Alan Liu (Inactive)
            foliversunw Fred Oliver (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: