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

ChangeEvent fires when mouse enters or exits JCheckBox

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P3
    • None
    • 1.3.0
    • client-libs

    Description

      Name: rmT116609 Date: 10/26/2000


      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
      Java HotSpot(TM) Client VM (build 1.3.0), mixed mode

      When the code below is run under linux JVM 1.2.2 moving the mouse in and out of
      the JCheckBox will not fire a ChangeEvent. When run under linux JVM 1.3
      ChangeEvents are fired when the mouse enters or exits the JCheckBox. The
      ChangeEvent is also fired under the Windows 1.3.0 JVM (no Windows 1.2.2 JVM to
      check against -sorry).

      This may be a problem with 1.2.2 or 1.3, i'm unsure whether sun intended to
      fire the event or not.

      // Code to check for ChangeEvents
      public class CheckBoxEvents extends Object {

          public static void main(String[] argv) {
              JCheckBox cb = new JCheckBox("Roll mouse over me");

              cb.addChangeListener( new ChangeListener () {
                  public void stateChanged(ChangeEvent e1) {
                      System.out.println("Change Event Caught");
                  }
              });

              JFrame f = new JFrame();
              //f.addWindowListener(new BasicWindowMonitor() );
              Container c = f.getContentPane();
              c.add(cb);
              f.pack();
              f.setVisible(true);
          }

      }
      (Review ID: 111033)
      ======================================================================

      Attachments

        Activity

          People

            peterz Peter Zhelezniakov
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: