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

JOptionPane confirm dialog buttons are not localized

XMLWordPrintable

    • 11
    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      openjdk version "11" 2018-09-25
      OpenJDK Runtime Environment 18.9 (build 11+28)
      OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      The button labels in JOptionPane confirm dialogs with JOptionPane.YES_NO_OPTION are not localized. Tested with Locale.ITALY and Locale.GERMANY.

      REGRESSION : Last worked in version 10.0.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the given code

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Buttons are labeled _S_i and _N_o
      ACTUAL -
      Buttons are labeled _Y_es and _N_o

      ---------- BEGIN SOURCE ----------
      package testcase.yesnooption;

      import java.util.Locale;
      import javax.swing.JOptionPane;

      public class MainApp {

          public static void main(final String[] args) {
              Locale.setDefault(Locale.ITALY);
              JOptionPane.showConfirmDialog(null, "Is this localized?", "Localized or not",
                      JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Use Java 8, 9 or 10

      FREQUENCY : always


            erikj Erik Joelsson
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: