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

Upper frame (from two available) retreats into the background

XMLWordPrintable

    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      jdk1.6.0_17

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP

      A DESCRIPTION OF THE PROBLEM :
      After the close of the modal dialogue, the upper frame (from two available) retreats into the background relative to another frame.




      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      - Compile and execute sample program.
      - Push [Close] button on dialog.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Modal dialog should disappear and frames should not change their z-order.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Button;
      import java.awt.Dialog;
      import java.awt.Frame;
      import java.awt.event.ActionEvent;
      import java.awt.event.ActionListener;

      import javax.swing.SwingUtilities;


      public class Test
      {
          public static void main(final String[] args) {
              final Frame frame1 = new Frame("Frame1");
              frame1.setBounds(0, 0, 300, 300);
              frame1.setVisible(true);

              final Dialog dialog = new Dialog((java.awt.Frame)null, "Dialog", true);

              final Button button = new Button("Close");
              button.addActionListener(new ActionListener()
              {
                  public void actionPerformed(ActionEvent e)
                  {
                      dialog.dispose();
                  }
              });
              
              SwingUtilities.invokeLater(new Runnable()
              {
                  public void run()
                  {
                      final Frame frame2 = new Frame("Frame2");
                      frame2.setBounds(100, 100, 300, 300);
                      frame2.setVisible(true);
                  }
              });

              dialog.add(button);
              dialog.pack();
              dialog.setLocationRelativeTo(null);
              dialog.setVisible(true);
            }
      }
      ---------- END SOURCE ----------

            denis Denis Fokin (Inactive)
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: