JDK-4447202 : German Umlauts don't work as button mnemonic
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2001-04-18
  • Updated: 2004-09-16
  • Resolved: 2004-09-16
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description

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) 
======================================================================

Comments
EVALUATION From Eric: > Unless we add keycodes for a-diaresis, o-diaresis, u-diaresis, etc., > I don't think those keys will work as accelerators. As per Eric's request, I'm reassigning to him. scott.violet@eng 2001-04-19 See a more general case: 4352104. eric.hawkes@eng 2001-04-19 One way to handle this would be to add keycodes for the German keys with umlauts (a-umlaut, u-umlaut, etc.). We have been hesitant to do this in the past because there doesn't seem to be any end of keyboards we could support (German, Spanish, French, Thai, Japanese, etc.). ###@###.### 2002-04-08 Close this bug as a duplicate of 4239028. ###@###.### 2004-09-16
08-04-2002