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

JSlider - keyboard controls use ticks if setSnapToTicks(false) is invoked

XMLWordPrintable

    • tiger
    • 5.0
    • sparc
    • generic

      If JSlider.setSnapToTicks(false) is invoked on a JSlider and the mouse is used to
      move the knob, the knob moves smoothly, as expected.
      However, if the keyboard (ie, the left and right arrow keys) is used to move the
      knob, the knob resolves to the closest tick mark; it doesn't move smoothly as when
      the mouse is used to move the knob. This behavior seems to be the same as the
      behavior when setSnapToTicks(true) is invoked on the slider.

      The fact that the JSlider is expected to behave this way if setSnapToTicks(false) is
      invoked on it and the keyboard is used to move the knob does not seem to be
      specified.
      If this is expected behavior, it should be specified.

      This behavior is seen when the following JCK 1.5 test is executed:
      api/javax_swing/interactive/JSliderTests.html#JSlider[JSliderTest0017]

      This behavior can be recreated by running the attached program
      (JSliderSnapToTicks.java), and using the keyboard to move the knob of the
      slider. The program displays a JSlider on which setSnapToTicks(false) has
      been invoked.




      ###@###.### 2003-10-08

            apikalev Andrey Pikalev
            larbouzo Leonid Arbuzov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: