EVALUATION
Name: ksT78225 Date: 01/20/99
(K Suresh, SIPTech, ###@###.###, January 20, 1999)
reproducible when tested with
WinNT, Win95
(JDK-1.1.7-K, JDK-1.2FCS-I)
not reproducible when tested with
Solaris sparc, x86
(JDK-1.1.7-K, JDK-1.2FCS-I)
---------------------------------------------------------
// Two test frames 'Test Frame1' and 'Test Frame2' appears.
// Click on the button 'Show Modal Dialog' in the Test Frame1,
// a Modal Dialog appears.
// Click on the button 'Click Me!' in the Test Frame2.
// If you get a message 'Test Frame2 Button Clicked' then
// the bug is not reproducible
import java.awt.*;
import java.awt.event.*;
public class ModalDialogTest {
Frame f1, f2;
Dialog d1;
Button b1, b2;
public ModalDialogTest() {
f1 = new Frame("Test Frame1");
d1 = new Dialog(f1, "Modal Dialog", true);
d1.setSize(150, 100);
d1.setLocation(225, 400);
d1.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent we) {
d1.setVisible(false);
}
});
b1 = new Button("Show Modal Dialog");
b1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
d1.setVisible(true);
}
});
f1.add(b1);
f1.setSize(175, 100);
f1.setLocation(0, 400);
f2 = new Frame("Test Frame2");
b2 = new Button("Click Me!");
b2.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
System.out.println("Test Frame2 Button Clicked");
}
});
f2.add(b2);
f2.setSize(175, 100);
f2.setLocation(400, 400);
f2.setVisible(true);
f1.setVisible(true);
}// ModalDialogTest()
public static void main(String args[]) {
new ModalDialogTest();
}
}
------------------------------------------------------------
======================================================================
This bug appears to be a duplicate of 4178473 "Dialogs needs modality
which blocks input only to owner window"
tim.bell@Eng 1999-06-24
=======================================================================
Tested the above source under Sun4 Solaris 2.7 and Windows NT 4.0 SP5
with JDK 1.3RA, and the result was the same as that under Windows. That
is the dialogs were globally modal. I am not sure if this is the correct
behaviour, and if this is then this bug can be closed.
sandeep.konchady@Eng 1999-12-21
It would be desirable to support this owner-style modality (in addition
to current toolkit-style modality). This should be marked as an RFE,
not a bug. see: http://javaweb.eng/~dpm/modal.txt
amy.fowler@Eng 2000-02-17
All the new features introduced by the fix for this CR can be found in JavaDoc files. See java.awt package description, AWT Modality Spec at the bottom of the page in the same section as AWT Focus Spec.
###@###.### 2005-05-26 12:09:37 GMT
|
SUGGESTED FIX
New modality modes are added: document, application, toolkit. Toolkit modality is the only one that was available before the fix. Modal dialogs with different modality types differ by the set of Java top-level windows that are blocked, when the dialog is visible. See Dialog.ModalityType enum and Dialog.get/setModalityType methods for details.
Two modal exclusion types are added: application and toolkit exclusion. Exclusion allows any window not to be blocked by modal dialogs. See Dialog.ModalExclusionType enum and Window get/setModalExclusionType methods for details.
There is a possibility to check if new features are supported by current Toolkit. See Toolkit.isModalityTypeSupported and Toolkit.isModalExclusionTypeSupported methods for details.
###@###.### 2005-05-04 11:41:16 GMT
|