Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6743466

PIT: Modal dialog dn't come to above the parent frame after clicking

XMLWordPrintable

    • x86
    • windows_xp

      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);
          }
      }

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

            anthony Anthony Petrov (Inactive)
            lpremkumsunw Lawrence Premkumar1 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: