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

JSpinner component does not fire MouseEvent.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.2
    • client-libs



      Name: rmT116609 Date: 08/12/2004


      FULL PRODUCT VERSION :
      java version "1.4.2_05"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
      Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)


      FULL OS VERSION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      1. Create a new JSpinner component.
      2. Implements methods of MouseListener and register listener to JSpinenr instance.
      3 Run GUI.
      4. Try to click on JSpinner instance by mouse.

        Description:
      I have found the similar event problem on Bug Id: 4760088 .

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      JSpinner does not fire a mouse event.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class SFrame extends javax.swing.JFrame {
          
          public SFrame() {
              initComponents();
          }
          
          private void initComponents() {
              jSpinner1 = new javax.swing.JSpinner();
              jLabel1 = new javax.swing.JLabel();
              jTextField1 = new javax.swing.JTextField();

              getContentPane().setLayout(new java.awt.BorderLayout(2, 2));

              addWindowListener(new java.awt.event.WindowAdapter() {
                  public void windowClosing(java.awt.event.WindowEvent evt) {
                      exitForm(evt);
                  }
              });

              jSpinner1.addMouseListener(new java.awt.event.MouseAdapter() {
                  public void mouseClicked(java.awt.event.MouseEvent evt) {
                      java.lang.System.err.println("Mouse clicked: " + evt.getButton() );
                  }
              });

              getContentPane().add(jSpinner1, java.awt.BorderLayout.CENTER);
              jLabel1.setText("Mouse click does not fire event:");
              getContentPane().add(jLabel1, java.awt.BorderLayout.WEST);
              getContentPane().add(jTextField1, java.awt.BorderLayout.SOUTH);
              pack();
          }
          
          private void exitForm(java.awt.event.WindowEvent evt) {
              System.exit(0);
          }
          
          public static void main(String args[]) {
              new SFrame().show();
          }
          
          private javax.swing.JLabel jLabel1;
          private javax.swing.JSpinner jSpinner1;
          private javax.swing.JTextField jTextField1;
          
      }

      ---------- END SOURCE ----------
      (Incident Review ID: 217983)
      ======================================================================

            shickeysunw Shannon Hickey (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: