-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.1.8
-
generic
-
generic
It's possible to bring up two modal JOptionPane dialogs by hitting the Enter
key rapidly when the JOpitonPane dialog is created in response to an action event. This occurs with 1.1.8 on both on Solaris and win32.
Test case:
import com.sun.java.swing.*;
import com.sun.java.swing.event.*;
import java.awt.*;
import java.awt.event.*;
public class JOptionPaneTest extends JFrame implements ActionListener {
Object options[] = new Object[] { "OK" };
public JOptionPaneTest(String title) {
super(title);
getContentPane().setLayout(new BorderLayout());
JTextField tf = new JTextField("Hit Enter Twice Quickly Here");
getContentPane().add(tf, BorderLayout.NORTH);
tf.addActionListener(this);
}
public void actionPerformed(ActionEvent ae) {
JOptionPane.showOptionDialog(JOptionPaneTest.this, "Fail", "Failure", JOptionPane.O
K_OPTION, JOptionPane.QUESTION_MESSAGE, (Icon)null, options, options[0]);
}
public static void main(String[] argv) {
JOptionPaneTest dt = new JOptionPaneTest("Test");
dt.setSize(300, 300);
dt.show();
}
}
~
key rapidly when the JOpitonPane dialog is created in response to an action event. This occurs with 1.1.8 on both on Solaris and win32.
Test case:
import com.sun.java.swing.*;
import com.sun.java.swing.event.*;
import java.awt.*;
import java.awt.event.*;
public class JOptionPaneTest extends JFrame implements ActionListener {
Object options[] = new Object[] { "OK" };
public JOptionPaneTest(String title) {
super(title);
getContentPane().setLayout(new BorderLayout());
JTextField tf = new JTextField("Hit Enter Twice Quickly Here");
getContentPane().add(tf, BorderLayout.NORTH);
tf.addActionListener(this);
}
public void actionPerformed(ActionEvent ae) {
JOptionPane.showOptionDialog(JOptionPaneTest.this, "Fail", "Failure", JOptionPane.O
K_OPTION, JOptionPane.QUESTION_MESSAGE, (Icon)null, options, options[0]);
}
public static void main(String[] argv) {
JOptionPaneTest dt = new JOptionPaneTest("Test");
dt.setSize(300, 300);
dt.show();
}
}
~
- relates to
-
JDK-4195183 Hitting Enter Twice Quickly Invokes NullPointer Exception
- Closed