-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
1.4.1
-
Fix Understood
-
x86
-
windows_xp
Name: rmT116609 Date: 12/09/2002
FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows XP Home Version 5.1.2600
ServicePack 1
German-Version
A DESCRIPTION OF THE PROBLEM :
The localization of the menu shortcuts (like Ctrl+A) to
German (where it becomes Strg+A) doesn't depend on the
Menus locale nor on the used keyboard layout.
Instead it depends on the country set in Systemsteuerung
> "Regions- und Sprachoptionen" > "Regionale Einstellungen"
> "Standards und Formate"
(In an englisch version of WinXP you maybe find it this
way: "control panel" > "Region and language settings"
> "regional settings" (first file card) > the country on
this card.)
The usage of "Strg" instead of "Ctrl" should depend on the
locale of the menuitem or better on the currently used
windows keyboard-layout.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. set the country to "Germany" in the field described
above.
2. run the sample code (Strg+A will appear as shortcut in
the menu)
3. change your keyboard layout to US
4. run the sample code (again Strg+A will appear as
shortcut in the menu)
5. change the country to eg "USA"
6. run the sample code (Ctrl+A will appear as shortcut in
the menu)
7. change your keyboard layout to German
6. run the sample code (again Ctrl+A will appear as
shortcut in the menu)
EXPECTED VERSUS ACTUAL BEHAVIOR :
When using German keyboard layout Strg+A should appear.
When using English keyboard layout Ctrl+A should appear.
or
When the components locale is German Strg+A should appear.
When the components locale is English Ctrl+A should appear.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.event.*;
import javax.swing.*;
public class menubug
{
public static void main(String[] args) {
JFrame f = new JFrame();
f.setSize(200,100);
JMenuBar mb = new JMenuBar();
f.setJMenuBar(mb);
JMenuItem mi = new JMenuItem("localized menu");
mi.setLocale(java.util.Locale.US); // this doesn't affect anything
mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A,ActionEvent.CTRL_MASK));
mb.add(mi);
f.show();
try { Thread.sleep(2000); }
catch(Exception e) {}
System.exit(0);
}
}
---------- END SOURCE ----------
(Review ID: 165107)
======================================================================