-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.3.0
-
generic
-
generic
Name: skT88420 Date: 01/05/2000
C:\Java\Src\ui>java -version
java version "1.2.2"
Classic VM (build JDK-1.2.2-001, native threads, symcjit)
C:\Java\Src\ui>
The following applet will cause a NullPointerException when dismissing
the internal message dialog. To verify, run applet, press button to show
message dialog, press OK on internal message dialog. The error does not
occur if the call to showInternalMessageDialog is replaced with a call
to showMessageDialog.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class msg_test extends JApplet
{
public void init()
{
JButton showMsgButton = new JButton("Show Message");
showMsgButton.setDefaultCapable(true);
showMsgButton.addActionListener(new ShowMsgListener());
getRootPane().setDefaultButton(showMsgButton);
getContentPane().add(showMsgButton, BorderLayout.SOUTH);
}
class ShowMsgListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
JOptionPane.showInternalMessageDialog(getContentPane(), "Press OK to test message dialog!");
}
}
}
The above can be tested with the following HTML code:
<HTML>
<APPLET code="msg_test.class" width=400 height=300>
</APPLET>
</HTML>
(Review ID: 99620)
======================================================================