-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
1.2.0
-
sparc
-
solaris_2.6
When a JOptionPane is created in respnse to an action event, a NullPointerException is generated:
%java JOptionPaneTest
java.lang.NullPointerException: NullPointerException
at sun.awt.motif.MDialogPeer.pShow(Native Method)
at sun.awt.motif.ModalThread.run(Compiled Code)
This occurs in 1.2 on Solaris only.
Test case:
import javax.swing.*;
import javax.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();
}
}
~
%java JOptionPaneTest
java.lang.NullPointerException: NullPointerException
at sun.awt.motif.MDialogPeer.pShow(Native Method)
at sun.awt.motif.ModalThread.run(Compiled Code)
This occurs in 1.2 on Solaris only.
Test case:
import javax.swing.*;
import javax.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-4195148 Hitting Enter Twice Quickly Brings Up Two Modal Dialogs
- Closed