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

ChangeListener event generated when mouse rolls over component on 1.3 NT

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.0
    • client-libs
    • None

      Running "jdk1.3.0rc1-T" on Windows NT ServicePack6a an abstract button generates
      a change event when the mouse passes over a JButton. This behaviour is not
      exhibited on "1.3beta-0" on Solaris Sparc.

      The following test code illustrates the problem :

      // java import
      import java.awt.*;
      import javax.swing.*;
      import javax.swing.event.*;

      //

      public class Test extends JFrame implements ChangeListener {
      private JButton b1, b2;

          public Test () {
              super("Test");
      getContentPane().setLayout(new FlowLayout());
      getContentPane().add(b1 = new JButton("b1"));
      b1.addChangeListener(this);
      getContentPane().add(b2 = new JButton("b2"));
      b2.addChangeListener(this);
      pack();
      setVisible(true);
          }
      public void stateChanged(ChangeEvent e) {
      System.out.println("Should not get this event unless a button is clicked --->");
      }

      public static final void main(String args[]) {
      Test t = new Test();
      }
      }

            apikalev Andrey Pikalev
            skrugersunw Stephen Kruger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: