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

JDK 1.1.5C REGRESSION: MODAL DIALOGS CANNOT BE HIDDEN

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P1 P1
    • None
    • 1.1.5
    • client-libs
    • None
    • x86
    • windows_nt


      ingrid.yao@Eng 1997-10-21

      REGRESSION bug reported by Oracle:



      This is a rather gross bug that occurred between JDK 1.1.5A and 1.1.5C.
      Please fix it ASAP, preferably by JDK 1.1.5D. Here is the test case:
       
      /*
      Filename: b567200.java
       
      Platform: Windows NT 4.0
      Command Line: java b567200
       
      Directions and Expected Results:
       
      - Run the test case, which displays a Frame.
      - Click on the "Dialog!" button of the displayed Frame.
        A modal Dialog should appear.
      - Click on the modal Dialog's "Hide!" button:
        ... if the bug exists, the modal Dialog does not disappear
            as expected, although the VM returns the focus back to
            the original Frame. You may even be able to create
            other modal Dialogs by pressing on the "Dialog!" button.
            Sometimes the modal Dialog does disappear, but the VM hands.
        ... if the bug has been fixed, the modal Dialog is hidden.
      */
       
      import java.awt.*;
      import java.awt.event.*;
       
      public class b567200 extends Frame implements ActionListener
      {
      static public void main(String[] args)
      {
      b567200 bb = new b567200();
      bb.setBounds(10,10,350,350);
      bb.setVisible(true);
      }
       
      public b567200()
      {
      super();
      setLayout(null);
      Button dlgButton = new Button("Dialog!");
      dlgButton.setBounds(200,250,100,50);
      add(dlgButton);
      dlgButton.addActionListener(this);
      }

      public void actionPerformed(ActionEvent e)
      {
      MyDialog dlg = new MyDialog(this);
      dlg.setBounds(400, 100, 300, 300);
      dlg.setVisible(true);
      }
      }
       
      class MyDialog extends Dialog implements ActionListener
      {
      MyDialog(Frame parent)
      {
      super(parent,"Test Dialog", true);
      Button dlgButton = new Button("Hide!");
      dlgButton.setBounds(200,250,100,50);
      add(dlgButton);
      dlgButton.addActionListener(this);
      }

      public void actionPerformed(ActionEvent e)
      {
      setVisible(false);
      }
      }
       

            duke J. Duke
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: