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

TextField causes a motif warning to display ISO8859-1 characters(in

XMLWordPrintable

    • sparc
    • solaris_2.5.1



      Name: ccC48265 Date: 01/09/98


      TextField causes a motif warning to display ISO8859-1 characters
      in Japanese Environment(Solaris 2.5.1, LANG=ja).
      And no charcter after the charactor is displayed.
      Warning message is following.

      Couldn't determine the codeset: No such file or directory
      Couldn't determine the codeset: No such file or directory
      Couldn't determine the codeset: No such file or directory
      Couldn't determine the codeset: Error 0
      Couldn't determine the codeset: Error 0
      Couldn't determine the codeset: Error 0

      The following program displays a string
      which contains Japanese characters and ISO-8859-1 characters.

      In JDK 1.1.5 and JDK 1.2Z,
      ISO8859-1 charcters is displayed as '?' (substituted char).
      No warning is shown.


      import java.awt.*;
      import java.awt.event.*;

      class FontList extends Frame implements ItemListener {
          Label label;
          TextField textfield;

          public FontList() {
      super("FontList");

      MenuBar menuBar = new MenuBar();
      Menu menu = new Menu("File");
      MenuItem quitMenuItem = new MenuItem("Quit");
      menu.add(quitMenuItem);
      menuBar.add(menu);
      setMenuBar(menuBar);

      addWindowListener(new WindowDestroyListener());
      quitMenuItem.addActionListener(new QuitListener());

      Panel panel = new Panel();
      panel.setLayout(new BorderLayout());
      add(panel);

      label = new
      Label("\u3053\u308c\u306fFont\u306eTest\u3067\u3059\u3002\\\u30de\u30fc\u30af\u
      3068\u00a9\u30de\u30fc\u30af\u3068\uff76\uff80\uff76\uff85\u306f\u3069\u3046\u3
      04b\u306a\u3002");
      panel.add("North", label);

      textfield = new
      TextField("\u3053\u308c\u306fFont\u306eTest\u3067\u3059\u3002\\\u30de\u30fc\u30
      af\u3068\u00a9\u30de\u30fc\u30af\u3068\uff76\uff80\uff76\uff85\u306f\u3069\u304
      6\u304b\u306a\u3002");
      panel.add("Center", textfield);

      Panel choicePanel = new Panel();
      panel.add("South", choicePanel);

      Choice fontChoice = new Choice();
      fontChoice.addItem("Serif");
      fontChoice.addItem("SansSerif");
      fontChoice.addItem("Monospaced");
      fontChoice.addItem("Dialog");
      fontChoice.addItem("DialogInput");
      fontChoice.addItem("TimesRoman");
      fontChoice.addItem("Helvetica");
      fontChoice.addItem("Courier");
      fontChoice.addItem("ZapfDingBats");
      fontChoice.addItemListener(this);

      choicePanel.add(fontChoice);
      Font font = new Font("Serif", Font.PLAIN, 12);
      label.setFont(font);
      textfield.setFont(font);
          }

          public static void main(String args[]){
      FontList frame = new FontList();
      frame.pack();
      frame.setVisible(true);
          }

          public void itemStateChanged(ItemEvent e) {
      if (e.getStateChange() == ItemEvent.SELECTED) {
      String fontName = (String)e.getItem();
      Font font = new Font(fontName, Font.PLAIN, 12);
      textfield.setFont(font);
      label.setFont(font);
      }
          }
      }

      class WindowDestroyListener extends WindowAdapter {
          public void windowClosing(WindowEvent e) {
      System.exit(0);
          }
      }

      class QuitListener implements ActionListener {
          public void actionPerformed(ActionEvent e) {
      System.exit(0);
          }
      }
      (Review ID: 22915)
      ======================================================================

            serb Sergey Bylokhov
            ccresswesunw Claudette Cresswell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: