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

REG: Extra ActionEvent fired on win32

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.4.2
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      x86
    • OS:
      windows_nt

      Description

      Pressing mouse buttons in a certain way on java.awt.Buttons can cause two ActionEvents to be fired, instead of just one. Consider this simple test case:

      // Test of double ActionEvents

      import java.awt.*;
      import java.awt.event.*;

      public class ActionTest extends Frame implements ActionListener {
          Button b;

          public ActionTest() {
              super("ActionTest");
              b = new Button("Action Listening Button");
              b.addActionListener(this);
              add(b);
              setSize(200, 200);
          }

          static int i = 0;
          public void actionPerformed(ActionEvent e) {
              System.out.println("actionPerformed() called - " + (i++));
          }

          public static void main(String[] args) {
              ActionTest at = new ActionTest();
              at.show();
          }
      }

      ---
      Press both the left and right mouse buttons while over the Action Listening Button. Next, release the left mouse button. You will see that actionPerformed() is called twice. This is a regression since 1.3.1, and does not happen on Solaris. See also bug 4530087.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bchristi Brent Christian
              Reporter:
              bchristi Brent Christian
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: