-
Bug
-
Resolution: Won't Fix
-
P5
-
None
-
1.4.0
-
x86
-
windows_95
Key-index.html does not have any key entries for JScrollbars. setFocusEnabled(true) allows focus on the keyboard, but there is no spec as to what key bindings should do on this component. They seem to act the same as JSlider.
Sample below allows the slider to accept focus and keyboard to be used.
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(162,24,39,236);
}
static public void main(String args[]){
(new JFrame1()).setVisible(true);
}
javax.swing.JScrollBar JScrollBar1 = new javax.swing.JScrollBar();
}
Sample below allows the slider to accept focus and keyboard to be used.
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(162,24,39,236);
}
static public void main(String args[]){
(new JFrame1()).setVisible(true);
}
javax.swing.JScrollBar JScrollBar1 = new javax.swing.JScrollBar();
}
- relates to
-
JDK-4177406 JScrollBars do not respond to arrow keys or the numeric keypad.
-
- Closed
-