-
Bug
-
Resolution: Fixed
-
P4
-
1.2.2
-
beta
-
x86
-
windows_nt
Name: skT88420 Date: 10/12/99
The problem can be observed by running the code below. It presents a small JFrame containing a menubar with two menus on it - "File" and "What?". The mnemonic for the first menu is 'F' and for the second menu is '?'. Alt-F successfully invokes the File menu, but neither Alt-Shift-? or Alt-? will invoke the What? menu.
This is a problem for us in the French version of our product. Apparently it is common to label help menus in French apps with a single '?' character.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class TestFrame
extends JFrame
{
public TestFrame()
{
setSize(100, 100);
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
getContentPane().add(topPanel);
JMenuBar menuBar = new JMenuBar();
setJMenuBar( menuBar );
JMenu file = new JMenu("File");
file.setMnemonic('F');
file.add(new JButton("New"));
JMenu help = new JMenu("What?");
help.setMnemonic('?');
help.add(new JButton("Index"));
menuBar.add(file);
menuBar.add(help);
}
public static void main(String args[])
{
TestFrame mainFrame = new TestFrame();
mainFrame.setVisible(true);
}
}
(Review ID: 96402)
======================================================================