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

Nested modal dialog fails to return to the parent frame in JDK1.1.1

XMLWordPrintable

    • b01
    • x86, sparc
    • solaris_2.4, solaris_2.5.1, windows_95, windows_nt
    • Not verified

      I tested in JDK1.1, it ran fine, however in JDK1.1.1, this was definitely
      a bug. This problem doesn't exists in Solaris.
      Please see the attachments for a reproducible test case.
      -------------------------------------------------------------------------------

      The bug report that appears to be very close to what we are experiencing is 4032124.
      It appeared to be fixed in jdk1.1 but has returned in jdk1.1.1.

      The following is the code to reproduce the problem.

       
      To make this happen do the following:
      1. run testDlgs
      2. select dialog #1
      3. select dialog #2 while in dialog #1
      4. cancel dialog #2
      5. cancel dialog #1
      This appears to work but without exiting the program do step 1-5 again. This time
      It will freeze the frame when canceling out of dialog #1.

      Carleton Struthers
      Dan Xu
      FTP Software Inc.
      ###@###.###
      ###@###.###

      -------------------------------------------------------------------------------
      Customer added the following problem in the same attached test cases. (04/24/97)


      Hi
      Its carl struthers again with more pain. We have another bug that is critical an very easy to reproduce using the same test code we sent before. It causes the focus manager to rip. The following is the method to reproduce the problem.

      1. Start testDlgs.class using jdk1.1.1
      2. Select show dialog
      3. With mouse set focus to another window other than the testDlgs window
      4. Now set focus back to testDlgs dialog box
      5. Depress tab key. ( this will cause a rip to occur in the dos window

      Important note: THIS DOES NOT HAPPEN ON JDK1.1

      -----------------------------------------------------------------
      Additional note from the customer (April 30, 97)

      Hi
      This is Carl Struthers at FTP Software Inc. and I am just checking in to see whether there is any status change of bug 4046833. This is the chained modal dialog hang.

      There is one new observation that may mean something but again may just be noise. This is that on fast machines 200mh pc's the problem does not appear to happen as frequently.

      Carl Struthers
      ###@###.###


      This testcase runs fine in jdk1.1 but does not work in jdk1.1.1

      import java.awt.*;
      import java.awt.event.*;
      import java.lang.*;
      import java.io.*;
      import java.util.*;



      public class modal_dlg_test extends Frame
      {
              public static void main( String args[] )
              {
                      int i=1;
                      Frame f = new Frame("Test Modal Dialogs");
                      f.add(new TextArea(10,10));
                      f.pack();
                      f.setVisible( true );

                      while (true)
                      {
                              System.out.println("\n****** Iteration #"+i+" ******"); i++;

                              // Launching the modal dialog
                              System.out.println("Launching Modal Dialog");
                              modal_1 m = new modal_1( f, "Dialog A" );
                              m.setVisible( true );
                              System.out.println("Done Modal Dialog");
                              m.dispose();
                              System.out.println("Disposed Modal Dialog");
                      }
              }
      }

      class modal_1 extends Dialog implements ActionListener {
              Frame par;

              public modal_1( Frame parent, String title )
              {
                      super( parent, title, true );

                      par = parent;
                      setLayout( new FlowLayout() );
                      Button b =new Button("Sub-Dialog");
                      add(b);
                      b.addActionListener( this );
                      b = new Button("Close");
                      add(b);
                      b.addActionListener( this );
                      setLocation(300, 300);
                      pack();
              }

              public void actionPerformed( ActionEvent e )
              {
                      if (e.getActionCommand().equals("Sub-Dialog"))
                      {
                              modal_2 m=new modal_2(par, "Sub Dialog");
                              System.out.println("Launching Modal Sub-Dialog");
                              m.setVisible( true );
                              System.out.println("Done Modal Sub-Dialog");

                              //
                              // YOU MAY COMMENT OUT THIS CALL TO 'dispose'
                              // FOR SLIGHTLY DIFFERENT WIERD BEHAVIOUR
                              //
                              m.dispose();

                              System.out.println("Disposed Modal Sub-Dialog");
                      }
                      else if (e.getActionCommand().equals("Close"))
                      {
                              System.out.println("Closing modal_1");
                              setVisible( false );
                              System.out.println("Closed modal_1");
                      }
              }
      }

      class modal_2 extends Dialog implements ActionListener {
              Frame par;

              public modal_2( Frame parent, String title )
              {
                      super( parent, title, true );

                      setLayout( new FlowLayout() );
                      Button b = new Button("Close");
                      b.addActionListener( this );
                      add(b);
                      setLocation(350, 350);
                      pack();
              }

              public void actionPerformed( ActionEvent e )
              {
                      if (e.getActionCommand().equals("Close"))
                      {
                              System.out.println("Closing modal_2");
                              setVisible( false );
                              System.out.println("Closed modal_2");
                      }
              }
      }

      nasser.nouri@Corp 1997-05-01

            jlockesunw Jonathan Locke (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: