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

showing modal dialog allows mouse input to blocked window for a brief period

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.2.0, 1.4.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_8

      Description

      From: ###@###.###
      Date: Thu, 09 Apr 98 09:00:14 -0800
      To: <###@###.###>
      Subject: BUG with JButton, ActionListener and modal JDialogs

      I running swing 1.0.1, JDK1.1.5, Windows 95 and Windows NT4.0

      When a user clicks a JButton multiple times very fast, I get multiple modal
      JDialogs. This is true also with the dialogs created by the JOptionPane. Is it
      not true that each click will cause the ActionListener to run in the dispatch
      thread? It seems as if in the dispatch thread when a modal dialog is showing,
      the thread goes on and accepts more input from the JButton. I believe that the
      AWT or JFC should not accept other messages comoing from the same button until
      the whole function is finished executing including the modal JDialog. This is
      also the case when catching key strokes using the registerKeyboardAction call(if
      you keep clicking the keys fast). Here is a piece of cod:

      class ModifyListener implements ActionListener{
              JDialog dlg = null;
              public void actionPerformed(ActionEvent e) {
                  
                      dlg = new JDialog(frame,
      resource.getString("ModifyDialog.Title"), true);
                      ......
                      .......
                      dlg.show();
              }
      }

      .........

      JButton b = new JButton();
      b.addActionListener(new ModifyListener());


      This behavior is the same when showing dialogs created by the JOptionPane.

      Also when using buttons like cancel and ok in dialogs, when one button is
      pressed, for example ok, then the AWT or swing should not allow the user to
      immediately press the cancel before the dialog goes away. It seems like that in
      my dialogs the user can concurrently press any of the buttons while the code is
      in another ActionListener.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                son Oleg Sukhodolsky (Inactive)
                Reporter:
                rkarsunw Ralph Kar (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: