メニューのニモニックキーが、テキストフィールドに入力されてしまう。
右クリックして、ニモニックキーの'p'を押すと、

次に表示されたダイアログ上のテキストフィールドに"p"が入力されてしまうことがある。うちの環境だと10回に1回くらい起きる。

Bug Parade見ると、1.2あたりのころから報告されているようだけど「再現せず」で終わっているみたい。だめもとで新たに(ID 725191)で入れてみた。
import java.util.*;
public class Test extends javax.swing.JFrame {
public Test() {
jPopupMenu1 = new javax.swing.JPopupMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenuItem1.setMnemonic('P');
jMenuItem1.setText("Property");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jPopupMenu1.add(jMenuItem1);
getContentPane().setLayout(new java.awt.FlowLayout());
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
formMouseClicked(evt);
}
});
pack();
}
private void formMouseClicked(java.awt.event.MouseEvent evt) {
jPopupMenu1.show(this, evt.getX(), evt.getY());
}
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
new NewJDialog(this, true).setVisible(true);
}
static class NewJDialog extends javax.swing.JDialog {
public NewJDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
getContentPane().add(jTextField1, java.awt.BorderLayout.NORTH);
jButton1.setText("CLOSE");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
getContentPane().add(jButton1, java.awt.BorderLayout.SOUTH);
pack();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
setVisible(false);
}
javax.swing.JButton jButton1;
javax.swing.JTextField jTextField1;
}
public static void main(String[] args) {
Test test = new Test();
test.setBounds(0, 0, 300, 300);
test.setVisible(true);
}
javax.swing.JButton jButton1;
javax.swing.JMenuItem jMenuItem1;
javax.swing.JPopupMenu jPopupMenu1;
}








