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

Regression in JDK1.1.7! Modaldialog becomes not modal.

XMLWordPrintable

    • 1.1.8
    • x86
    • windows_95
    • Verified



      Name: clC74495 Date: 11/19/98


      0. Requests.
        Since, this is a serious problem to our program.
        I'd like to ask you the followings:
         -Please fix this problem as soon as possible.
         -Don't remove JDK1.1.6 from the download area untill this problem has been fixed.
        Regards,

      1.Step to reproduce the problem.
        (1)Click the frame
        (2)Click the ModelessDialog that has been created.
        (3)Click the ModalDialog that has been created.
        (4)Click the ModalDialog that has been created.
        (5)Click the ModalDialog that has been created.
        (6)Close the dialog that has been created by step (5).
        (7)Close the dialog that has been created by step (4).
        (8)Despite the ModalDaialog still there, focus can be moved to the frame or the ModelessDialog.

      2. Program to demonstrate the problem.
      import java.awt.*;
      import java.awt.event.*;

      class SyuuFrame extends Frame{
      static SyuuFrame frame = null;

      SyuuFrame(String title){
      super(title);
      setLayout(new FlowLayout());
      add(new Button("button"));
      addMouseListener(new MouseAdapter(){
      public void mouseClicked(MouseEvent evt){
      SyuuDialog1 dialog = new SyuuDialog1(SyuuFrame.frame,
      "ModlessDialog", false);
      dialog.setVisible(true);
      }
      });
      addWindowListener(new WindowAdapter(){
      public void windowClosing(WindowEvent evt){
      System.exit(1);
      }
      });
      setSize(300, 300);
      }

      public static void main(String args[]){
      frame = new SyuuFrame("Frame");
      frame.setVisible(true);
      }
      }

      class SyuuDialog1 extends Dialog implements ActionListener{
      private Button button = null;
      SyuuDialog1(Frame frame, String title, boolean flag){
      super(frame, title, flag);

      button = new Button("Close");
      setLayout(new FlowLayout());
      add(button);
      addMouseListener(new MouseAdapter(){
      public void mouseClicked(MouseEvent evt){
      SyuuDialog2 dialog = new SyuuDialog2(SyuuFrame.frame,
      "ModalDialog1", true);
      dialog.setVisible(true);
      }
      });
      addWindowListener(new WindowAdapter(){
      public void windowClosing(WindowEvent evt){
      setVisible(false);
      dispose();
      }
      });
      button.addActionListener(this);
      setSize(100, 100);
      }

      public void actionPerformed(ActionEvent evt){
      Dialog dialog = (Dialog)button.getParent();
      dialog.setVisible(false);
      }
      }

      class SyuuDialog2 extends Dialog implements ActionListener{
      private Button button = null;
      SyuuDialog2(Frame frame, String title, boolean flag){
      super(frame, title, flag);

      button = new Button("Close");
      setLayout(new FlowLayout());
      add(button);
      addMouseListener(new MouseAdapter(){
      public void mouseClicked(MouseEvent evt){
      SyuuDialog3 dialog = new SyuuDialog3(SyuuFrame.frame,
      "ModalDialog2", true);
      dialog.setVisible(true);
      }
      });
      addWindowListener(new WindowAdapter(){
      public void windowClosing(WindowEvent evt){
      setVisible(false);
      dispose();
      }
      });
      button.addActionListener(this);
      setSize(100, 100);
      }

      public void actionPerformed(ActionEvent evt){
      Dialog dialog = (Dialog)button.getParent();
      dialog.setVisible(false);
      }
      }

      class SyuuDialog3 extends Dialog implements ActionListener{
      private Button button = null;
      SyuuDialog3(Frame frame, String title, boolean flag){
      super(frame, title, flag);

      button = new Button("Close");
      setLayout(new FlowLayout());
      add(button);
      addMouseListener(new MouseAdapter(){
      public void mouseClicked(MouseEvent evt){
      SyuuDialog4 dialog = new SyuuDialog4(SyuuFrame.frame,
      "ModalDialog2", true);
      dialog.setVisible(true);
      }
      });
      addWindowListener(new WindowAdapter(){
      public void windowClosing(WindowEvent evt){
      setVisible(false);
      dispose();
      }
      });
      button.addActionListener(this);
      setSize(100, 100);
      }

      public void actionPerformed(ActionEvent evt){
      Dialog dialog = (Dialog)button.getParent();
      dialog.setVisible(false);
      }
      }

      class SyuuDialog4 extends Dialog implements ActionListener{
      private Button button = null;
      SyuuDialog4(Frame frame, String title, boolean flag){
      super(frame, title, flag);
      button = new Button("Close");
      setLayout(new FlowLayout());
      add(button);
      button.addActionListener(this);
      addWindowListener(new WindowAdapter(){
      public void windowClosing(WindowEvent evt){
      setVisible(false);
      dispose();
      }
      });
      setSize(100, 100);
      }

      public void actionPerformed(ActionEvent evt){
      Dialog dialog = (Dialog)button.getParent();
      dialog.setVisible(false);
      }
      }
      (Review ID: 42852)
      ======================================================================

            rkhansunw Robi Khan (Inactive)
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: