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

REG: Extra ActionEvent fired on win32

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.2
    • 1.4.0
    • client-libs
    • mantis
    • x86
    • windows_nt

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: