JDK-6743466 : PIT: Modal dialog dn't come to above the parent frame after clicking
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-09-01
  • Updated: 2011-01-19
  • Resolved: 2008-11-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u14Resolved
Related Reports
Duplicate :  
Description
I have found two issues. 
Issue # 1.
---------
I have a frame & a dialog, which is launched using -Djava.security.manager, so that i can see the security warning icon. When both frame & dialog is visible. I press "start" + "D" button . So the all the windows on the destop gets minimized. Once again i press "start" + "D" button. So that minimized windows on the desktop , gets restored. Now the dialog goes behind the frame.  According to modality the modal dialog should be always above the parent frame. This can be reproduced from jdk 1.6.0 b104 , 6u10 &  6u11 b01 pit build.

Issue # 2 . 
-----------
Repeating the same step of Issue # 1. When the modal dialog is below its parent. When i click on the portion of the visible dialog, the dialog dn't come above the parent frame. This happens only in 6u11 b01 PIT build. 

I tested the same scenario, using previous build like 6u10 b29 & b30. Clicking on the dialog the dialog come above the frame. Hence its a regression from 6u10 b30 to 6u11 b01.

Step to reproduce:-
-------------------
1) Run the below testcase.  
java -Djava.security.manager ModalityBug

2) ress "start" + "D" button . So the all the windows on the destop gets minimized. Once again i press "start" + "D" button. So that minimized windows on the desktop , gets restored. Observe that dialog is below the frame. If you see the same then the bug is reproduce Issue # 1 .
3) Click on the portion of the visible dialog. If the dialog dn't come above the parent frame , then the bug is reproduced. Issue #2.


============ Testcase ====================
import java.awt.*;

public class ModalityBug {

    public static void main(String[] args) {
        Frame f = new Frame("Test frame");
        f.setSize(200, 200);
        f.setLocation(100, 100);

        Dialog d = new Dialog(new Frame(), "Modal dialog");
        d.setLayout(new FlowLayout());
        d.add(new Button("b1"));
        d.setSize(200, 200);
        Button dbutton = new Button("Dialog Button");
		dbutton.addActionListener(new java.awt.event.ActionListener(){
			public void actionPerformed(java.awt.event.ActionEvent ae){
				System.out.println("dialog button is pressed");
			}
		});
		dbutton.addFocusListener(new java.awt.event.FocusListener(){
			public void focusGained(java.awt.event.FocusEvent e){
				System.out.println("Button gained focus");
			}
			public void focusLost(java.awt.event.FocusEvent e){
				System.out.println("Button lost focus");
			}
		});
        d.add(dbutton);

        d.setLocation(140, 140);
        d.setModal(true);

        f.setVisible(true);
        d.setVisible(true);
    }
}

========================================

Comments
EVALUATION As issue #2 is no longer reproducible in 6u12-b01 with the new implementation of warning banner, and issue #1 is described in 6438993, I'm closing this CR as duplicate of the latter.
06-11-2008

EVALUATION There is a similar problem - 6438993 (Modal dialog goes behind the parent frame when parent is restored from iconify state).
03-09-2008