-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.1.5, 1.2.0
-
x86
-
windows_95, windows_nt
Name: rk38400 Date: 04/07/98
This issue was supposed to be closed (bug 4089641), but I my application still echoes the Mnemonic into my JTextField.
Here is the Swing-1.0 code:
import java.awt.*;
import java.awt.event.*;
import com.sun.java.swing.*;
public class SimpleExample extends JPanel {
static JFrame frame;
public SimpleExample() {
JMenuBar mb=new JMenuBar();
JMenu mn=(JMenu)mb.add(new JMenu("Test"));
mn.setMnemonic('T');
JMenuItem mi=(JMenuItem)mn.add(new JMenuItem("This"));
mi.setMnemonic('i');
add(mb);
add(new JTextField(10));
}
public static void main(String s[]) {
SimpleExample panel = new SimpleExample();
frame = new JFrame("SimpleExample");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
});
frame.getContentPane().add("Center", panel);
frame.pack();
frame.setVisible(true);
}
}
Triggering the mnemonic echoes an 'i' into the JTextField. (Set focus on text field, then press <Alt-T><'i'>)
Note: The character isn't echoed if you press <Alt-T><Alt-i>, but I think it's supposed to work both ways...
(Review ID: 25789)
======================================================================
- relates to
-
JDK-4135578 Typing JMenuItem shortcut when the focus is in a JTextField adds character
-
- Closed
-