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

REGRESSION: Click & hold on arrow of JSpinner only transfers focus

XMLWordPrintable

    • beta
    • x86
    • windows_xp



        Name: gm110360 Date: 03/12/2004


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

        ADDITIONAL OS VERSION INFORMATION :
        Windows XP Pro

        A DESCRIPTION OF THE PROBLEM :
        When left mouse button is pressed and held on an arrow key of a JSpinner which does not already have focus the value remains static, changing by a single count when the button is released. Subsequent press/hold on an arrow when the component has focus will spin the value correctly.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Left-click and hold on an arrow key of a JSpinner which does not currently have focus. Watch the value not change until you release the button :-)

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Value should spin when click and hold on arrow even when JSpinner does not already have focus.
        ACTUAL -
        Value does not change until button is released and then only by a single count.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.awt.*;
        import java.awt.event.*;
        import javax.swing.*;
        import javax.swing.event.*;

        public class SpinBug extends JFrame
        {
           public static void main(String[] args)
           {
              SpinBug spinbug = new SpinBug();
           }

           public SpinBug()
           {
              super("JSpinner Bug");
              Container pane = getContentPane();
              pane.setLayout(new BorderLayout());
              pane.add(new JSpinner(new SpinnerNumberModel(0, -1000, 1000, 1)), BorderLayout.NORTH);
              pane.add(new JSpinner(new SpinnerNumberModel(1, -1000, 1000, 1)), BorderLayout.SOUTH);
              allowClosing();
              setBounds(0, 0, 100, 100);
              setVisible(true);
           }

           private void allowClosing()
           {
              addWindowListener (new WindowAdapter()
              {
                 public void windowClosing (WindowEvent e){System.exit(0); }
              });
           }
        }

        ---------- END SOURCE ----------

        Release Regression From : 1.4.2
        The above release value was the last known release where this
        bug was known to work. Since then there has been a regression.

        (Incident Review ID: 243222)
        ======================================================================

              kereminsunw Konstantin Eremin (Inactive)
              gmanwanisunw Girish Manwani (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: