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

A blocked Window appears above a modal dialog

XMLWordPrintable

    • b14
    • generic
    • generic
    • Verified

      This is reproducable from 1.4.2 onwards on all platforms.

      A blocked Window does not go behind a modal dialog when the Window comes up. When clicked anywhere on the Window, the window goes below the Dialog

      To reproduce:
      1. Run the below test. It shows a Dialog with a button in it
      2. Click the button - It'll show a Window.

      If the Window appears above the Dialog, the bug is reproduced. Click anywhere on the Window. It could be seen that the Window goes behind the Dialog

      import java.awt.*;
      import java.awt.event.*;

      public class Test {
          public static void main(String[] args) {
              Dialog d = new Dialog(new Frame());
              d.setModal(true);
              d.setLayout(new FlowLayout());
              final Window w = new Window(new Frame());
              w.setSize(200, 200);
              w.setLocation(100, 100);
              Button b = new Button("Click me");
              b.addActionListener(new ActionListener() {
                  public void actionPerformed(ActionEvent event) {
                      w.setVisible(true);
                  }
              });
              d.add(b);
              d.setSize(200, 200);
              d.setVisible(true);
          }
      }
      There is another problem, specific only to solaris/linux. When the window is shown, it is located above the modal dialog. When I click on the dialog, it comes to front, but subsequent click on the window brings it above the dialog again. On Windows, this doesn't happen: once the dialog is clicked, the window never comes to front (of course, until the dialog is dismissed).

            art Artem Ananiev (Inactive)
            gramachasunw Girish Ramachandran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: