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

Yes/No/OK/Cancel buttons are not localized on zh_HK locales.

    XMLWordPrintable

    Details

      Description


      ###@###.### 2003-09-01
      If the following program is invoked on zh_HK.UTF-8 or zh_HK.BIG5HK
      locales, Yes/No/OK/Cancel buttons are displayed in English.
      These buttons are localized if locales are zh_TW.*.
      ===
      sayama@kamo[8]% cat JOptionPaneSample.java
      import java.awt.FlowLayout;
      import java.awt.event.ActionEvent;
      import java.awt.event.ActionListener;

      import javax.swing.*;

      public class JOptionPaneSample {
              public static void main(String[] args) {
                      JFrame frame = new JFrame();
                      frame.setTitle("JOptionPaneSample");
                      frame.setBounds(0, 0, 200, 80);
                      frame.getContentPane().setLayout(new FlowLayout());
                      frame.getContentPane().add(getButton1());
                      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                      frame.setVisible(true);
              }

              private static JButton getButton1() {
                      JButton button = new JButton("button");
                      button.addActionListener(new ActionListener() {
                              public void actionPerformed(ActionEvent e) {
                                      JOptionPane.showConfirmDialog(null,
                                              "choose one",
                                              "choose one",
                                              JOptionPane.OK_CANCEL_OPTION);
                                      JOptionPane.showConfirmDialog(null,
                                              "choose one",
                                              "choose one",
                                              JOptionPane.YES_NO_OPTION);
                              }
                      });
                      button.setToolTipText("button");
                      button.setMnemonic('B');
                      return button;
              }
      }
      sayama@kamo[11]% javac JOptionPaneSample.java
      sayama@kamo[12]% java -version
      java version "1.4.1_04"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_04-b01)
      Java HotSpot(TM) Client VM (build 1.4.1_04-b01, mixed mode)
      sayama@kamo[13]% env LANG=zh_HK.BIG5HK DISPLAY=yokoyoko:0 java JOptionPaneSample
      sayama@kamo[16]% uname -a
      SunOS kamo 5.9 Generic_112233-09 sun4u sparc SUNW,Sun-Blade-100
      sayama@kamo[17]% cat /etc/release
                              Solaris 9 12/03 s9s_u5wos_06 SPARC
                 Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
                              Use is subject to license terms.
                                  Assembled 19 August 2003

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mfang Michael Fang (Inactive)
              Reporter:
              osayama Osamu Sayama (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: