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

JSlider ignores PageUp and PageDown

XMLWordPrintable

    • beta2
    • sparc
    • solaris_7



      Name: rmT116609 Date: 10/25/2000


      java version "1.2.2"
      Solaris VM (build Solaris_JDK_1.2.2_06, native threads, sunwjit)


      When a JSlider is defined with negative numbers in its range the PageUp and
      PageDown keyboard keys do not work as defined in the Metal Look and Feel
      table. That is, they don't work at all for the slider.

      Sequence to reproduce the problem.
          o) Compile and run the following program.
          o) Activate the slider button by clicking on the thumb tab.
          o) Check that Home, End, and the Arrow keys function properly.
          o) Attempt a block move using the PageUp and PageDown keys.

      //---------

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

      public class SlideX extends JPanel {
          private static JFrame f = null;

          public SlideX() {
              this.setLayout(new BorderLayout());
              this.setBorder(new EmptyBorder(30,30,30,30));

              JSlider slider = new JSlider(-9,-1,-5);
              slider.putClientProperty("JSlider.isFilled",Boolean.TRUE);

              this.add(slider, BorderLayout.CENTER);
          }

          public static void main(String argv[]) {
              f = new JFrame("SlideX");
              f.addWindowListener(new WindowAdapter() {
                  public void windowClosing(WindowEvent e) { System.exit(0); }
              });
              SlideX t = new SlideX();
              f.getContentPane().add(t);
              f.pack();

              Dimension dm = Toolkit.getDefaultToolkit().getScreenSize();
              Dimension dt = f.getSize();

              // centered on the screen to start
              f.setLocation(dm.width/2-dt.width/2, dm.height/2-dt.height/2);
              f.setVisible(true);
          }
      }
      (Review ID: 111373)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: