JDK-4266981 : JOptionPane.showInternalMessageDialog() methods are not modal.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1999-08-30
  • Updated: 1999-08-31
  • Resolved: 1999-08-31
Related Reports
Duplicate :  
Relates :  
Description
JOptionPane.showMessageDialog() methods are modal.  Whereas,
JOptionPane.showInternalMessageDialog() methods are not.
However, the doc for JOptionPane class clearly stated that
"All dialogs are modal".

The following program demonstrates the problem of internal
message dialog not been modal.

Since jdk1.3 has the problem with internal message not displaying
(see bug #4256578), please use jdk1.2 to verify this
behavior.

------------------------------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class test extends JFrame {
    JButton b1 = new JButton("show internal message dialog");
    JButton b2 = new JButton("show external message dialog");

    public test() {
	Container contentPane = getContentPane();
	contentPane.setLayout(new FlowLayout());
	contentPane.add(b1);
	contentPane.add(b2);

	b1.addActionListener(new ActionListener() {
	    public void actionPerformed(ActionEvent e) {
		JOptionPane.showInternalMessageDialog(
		    b1,
		    "Hello World! this is an internal message dialog",
		    "Internal, Am I a Modal Dialog?",
		    JOptionPane.PLAIN_MESSAGE);
	    }
	});

	b2.addActionListener(new ActionListener() {
	    public void actionPerformed(ActionEvent e) {
		JOptionPane.showMessageDialog(
		    b2,
		    "Hello World! this is external message dialog",
		    "External, Am I a Modal Dialog?",
		    JOptionPane.INFORMATION_MESSAGE);
	    }
	});

	addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent we) {
                System.exit(0);
            }
        });

	setSize(500, 500);
	show();
    }
    static void main(String[] argv) {
	test t = new test();
   }
}
------------------------------------------------------------------------

Roger Pham 8/30/99