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

JScrollBar keyboard bindings have incorrect behavior for left/right,up/down keys

XMLWordPrintable

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

      JScrollBar does honor keyboard bindings, but it is backwards regarding the left/right arrow buttons. It does the correct thing for HOME/END/PAGEUP/PAGEDOWN buttons. Tab and shift-tab do nothing. If you have a horizontal scrollbar and hit the LEFT button, the knob moves right. It behaves incorrectly on Metal and Windows. In behaves incorrectly on releases 1.3 and 1.4. It behaves correctly with the up/down buttons on a vertical scrollbar.

      Here's a little sample program which exhibits the behavior:

      import java.awt.*;
      import javax.swing.*;
      public class JFrame1 extends javax.swing.JFrame
      {
            public JFrame1(){
                    getContentPane().setLayout(null);
                    setSize(405,305);
                    setVisible(false);
                    JScrollBar1.setRequestFocusEnabled(true);
                    getContentPane().add(JScrollBar1);
                    JScrollBar1.setBounds(10,10,236,39);
                    JScrollBar1.setOrientation(Adjustable.HORIZONTAL);
            }

            static public void main(String args[]){
                    (new JFrame1()).setVisible(true);
            }

            javax.swing.JScrollBar JScrollBar1 = new javax.swing.JScrollBar();


      }

            svioletsunw Scott Violet (Inactive)
            sharonz Sharon Zakhour (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: