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

modal dialog should come to the front

XMLWordPrintable

    • b38
    • generic, other, x86
    • generic, linux, linux_redhat_6.2, windows_98, windows_nt, windows_2000, windows_xp

      Name: skT88420 Date: 07/19/99


      If a modal dialog is open, a click to any top-level
      window of the application should bring
       the dialog
      to the front.
      Otherwise it takes sometimes a lot of shifting
      windows
       around until one finds the modal dialog on the
      desktop.
      (Review ID: 85760)
      ======================================================================

      Name: skT88420 Date: 12/20/99


      java version "1.3beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
      Java(TM) HotSpot Client VM (build 1.3beta-O, mixed mode)


      This happens in both 1.2.2 and 1.3beta.

      In the sample below, two JFrames are made, and one modal child dialog of frame
      one.

      Start the app in windows, and have some other app (a browser etc) running full
      screen.

      Alt-tab to some other full screen win app, so all the java app is obscured.
      Using the task bar in windows, select frame 2. This will bring only frame 2 to
      the front, and it will beep, because the modal dialog is still around for frame
      1. Users think the gui is locked!

      If you choose frame1 (the parent of the modal dialog), it's smart enough to
      bring up the modal dialog that's blocking it. This is what needs to happen for
      all JFrames that could be switched to.

      In my info below I am choosing "does this cause your program to hang?" because
      although it's not, my end users think it is and get stuck, sometimes killing
      the process unnecessarily.

      import javax.swing.*;

      public class Modal
      {
         public static void main(String args[])
         {
            JFrame frame1 = new JFrame("Frame 1");
            frame1.setSize(new Dimension(200,100));
            frame1.setLocation(0,0);

            JFrame frame2 = new JFrame("Frame 2");
            frame2.setSize(new Dimension(200,100));
            frame2.setLocation(200,0);

            JDialog dlog = new JDialog(frame1, true);
            dlog.setTitle("Modal child of frame 1");
            dlog.setSize(new Dimension(200,100));
            dlog.setLocation(150,50);

            frame1.show();
            frame2.show();
            dlog.show();
         }
      }
      (Review ID: 99224)
      ======================================================================

            art Artem Ananiev (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: