-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
13
-
x86_64
-
windows_10
ADDITIONAL SYSTEM INFORMATION :
Windows 10 vs 1903
java version "13.0.1" 2019-10-15
Java(TM) SE Runtime Environment (build 13.0.1+9)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
Whatever the operating system's language or an explicitly set default locale, JOptionPane's title and buttons are always displayed in English.
Was working correctly under jdk 10.0.2.
The bug might be related to bugJDK-8233045, which is resolved for jdk 14.
(Seems that old bugs 4137259, 4884480 have come back.)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
(Uncomment line 8,) compile and run the code below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Title and buttons according to current default locale.
ACTUAL -
English
---------- BEGIN SOURCE ----------
import java.util.*;
import javax.swing.*;
public class OptionPaneTest {
public OptionPaneTest() {
// If your operating system is English, set to any non-English locale.
// Locale.setDefault(Locale.FRENCH);
JComponent.setDefaultLocale(Locale.getDefault());
System.out.println(Locale.getDefault());
System.out.println(JComponent.getDefaultLocale());
// JOptionPane.showConfirmDialog(null, "Are you sure?");
JOptionPane.showConfirmDialog(null, "Ãtes-vous sûr?");
}
static public void main(String args[]) {
SwingUtilities.invokeLater(OptionPaneTest::new);
}
}
---------- END SOURCE ----------
FREQUENCY : always
Windows 10 vs 1903
java version "13.0.1" 2019-10-15
Java(TM) SE Runtime Environment (build 13.0.1+9)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
Whatever the operating system's language or an explicitly set default locale, JOptionPane's title and buttons are always displayed in English.
Was working correctly under jdk 10.0.2.
The bug might be related to bug
(Seems that old bugs 4137259, 4884480 have come back.)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
(Uncomment line 8,) compile and run the code below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Title and buttons according to current default locale.
ACTUAL -
English
---------- BEGIN SOURCE ----------
import java.util.*;
import javax.swing.*;
public class OptionPaneTest {
public OptionPaneTest() {
// If your operating system is English, set to any non-English locale.
// Locale.setDefault(Locale.FRENCH);
JComponent.setDefaultLocale(Locale.getDefault());
System.out.println(Locale.getDefault());
System.out.println(JComponent.getDefaultLocale());
// JOptionPane.showConfirmDialog(null, "Are you sure?");
JOptionPane.showConfirmDialog(null, "Ãtes-vous sûr?");
}
static public void main(String args[]) {
SwingUtilities.invokeLater(OptionPaneTest::new);
}
}
---------- END SOURCE ----------
FREQUENCY : always