-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
1.3.0
-
x86
-
windows_nt
Name: krC82822 Date: 04/18/2001
[filing as RFE, based on disposition of bug # 4425284]
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MnemonicButtonTest {
public static void main(String[] args){
JFrame frame = new JFrame("MnemonicTest");
Container contentPane = frame.getContentPane();
JButton change = new JButton("?ndern"); // "Change"-Button
JButton other = new JButton("Other");
other.setMnemonic('O');
other.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
System.out.println("Other action");
}
});
// Set the mnemonic char by virtual key code.
// 222 is A-Umlaut's virtual key code on German keyboard (Second key right
of 'L').
change.setMnemonic(222); // A-Umlaut not underlined. Keyboard shortcut
works.
//change.setMnemonic('?');
//change.setMnemonic('\u00C4'); // A-Umlaut's Unicode. A-Umlaut underlined.
Keyboard shortcut doesn't work.
change.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
System.out.println("Change action");
}
});
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
contentPane.setLayout(new FlowLayout());
contentPane.add(other);
contentPane.add(change);
frame.pack();
frame.setVisible(true);
}
}
(Review ID: 120839)
======================================================================
- duplicates
-
JDK-4239028 setMnemonic(char) must support non-english characters
-
- Open
-
- relates to
-
JDK-4760902 java.awt.Robot can't generate % character on FRENCH keyboard
-
- Open
-
-
JDK-4745053 RFE: Non-English letters don't work as button mnemonic
-
- Closed
-
-
JDK-4758891 RFE: Want to use German characters (ä,ö,ü,ß) as mnemonics
-
- Closed
-