jdk/src/share/classes/javax/swing/JLabel.java
changeset 2473 3f4bbd3be2f1
parent 466 6acd5ec503a8
child 5506 202f599c92aa
--- a/jdk/src/share/classes/javax/swing/JLabel.java	Thu Mar 26 14:38:46 2009 +0300
+++ b/jdk/src/share/classes/javax/swing/JLabel.java	Fri Mar 27 12:01:24 2009 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -503,10 +503,10 @@
      * @see #setDisplayedMnemonic(int)
      */
     public void setDisplayedMnemonic(char aChar) {
-        int vk = (int) aChar;
-        if(vk >= 'a' && vk <='z')
-            vk -= ('a' - 'A');
-        setDisplayedMnemonic(vk);
+        int vk = java.awt.event.KeyEvent.getExtendedKeyCodeForChar(aChar);
+        if (vk != java.awt.event.KeyEvent.VK_UNDEFINED) {
+            setDisplayedMnemonic(vk);
+        }
     }