-
Bug
-
Resolution: Fixed
-
P3
-
1.1, 1.1.4, 1.1.5, 1.1.6, 1.2.0
-
1.1.8
-
generic, x86, sparc
-
solaris_2.5.1, solaris_2.6, windows_95
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2019780 | 1.2.0 | Xianfa Deng | P3 | Closed | Fixed | 1.2fcs |
The following application displays a JDialog that is created by the
following constructor:
new JDialog(new JFrame(), "Modal Dialog", true)
The dialog created by this application is modal on Windows NT, but not
on Solaris.
=========================================================================
/*
* ModalDialogTest.java
* JDialog created with modality parameter set to true is not modal on
* Solaris
*
*/
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.*;
import java.awt.swing.*;
public class ModalDialogTest extends JPanel implements ActionListener {
JDialog dialog = new JDialog(new JFrame(), "Modal Dialog", true);
public static void main( String[] argv ) {
new ModalDialogTest();
}
public ModalDialogTest() {
JFrame frame = new JFrame("Modal Dialog Test");
JPanel controlPanel = new JPanel();
JPanel infoPanel = new JPanel();
JButton showButton = new JButton("Show Modal Dialog");
JButton testButton = new JButton("Test");
frame.getContentPane().setLayout(new BorderLayout());
infoPanel.setLayout(new GridLayout(0,1));
showButton.setOpaque(true);
showButton.setBackground(Color.yellow);
testButton.setOpaque(true);
testButton.setBackground(Color.pink);
controlPanel.add(showButton);
controlPanel.add(testButton);
infoPanel.add(new JLabel("Click the \"Show Modal Dialog\" button to display a modal JDialog."));
infoPanel.add(new JLabel("Click the \"Test\" button to verify dialog modality."));
frame.getContentPane().add(BorderLayout.NORTH, controlPanel);
frame.getContentPane().add(BorderLayout.SOUTH, infoPanel);
dialog.setSize(200,200);
showButton.addActionListener(this);
testButton.addActionListener(this);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
public void windowClosed(WindowEvent e) {System.exit(0);}
});
frame.pack();
frame.setSize(450, 120);
frame.setVisible(true);
}
public void actionPerformed(ActionEvent evt) {
String command = evt.getActionCommand();
if (command == "Show Modal Dialog") {
System.out.println("*** Invoking JDialog.show() ***");
dialog.setLocation(200,200);
dialog.show();
}
else if (command == "Test") {
System.out.println("*** Test ***");
}
}
}
=========================================================================
- backported by
-
JDK-2019780 modal dialogs don't properly block input to all windows on Solaris/1.2
-
- Closed
-
- duplicates
-
JDK-4036629 Modal dialog does not prevent events on Solaris
-
- Closed
-
-
JDK-4097340 595310:DIALOG MODALITY IMPLEMENTATION IS INCONSISTENT ACROSS PLATFORMS
-
- Closed
-
- relates to
-
JDK-4170640 Modal dialogs do not properly block
-
- Closed
-
-
JDK-4869318 Add support for parent window modality
-
- Closed
-