-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
5.0
-
generic
-
generic
Name: jbT81659 Date: 10/08/2003
Locale: ar_EG, iw_IL
REGRESION: Yes
Build: JDK1.5.0-b22
Horizontal and Vertical Scrollbars do not respond to keyboard keys like arrows (Up, Down, Right, Left, PageDown and PageUp). Horizontal and Vertical Scrollbars still respond to the mouse.
Under Redhat9 Linux, the following error was generated after executing a jScrollBar.java test case:
--------------------------------------------------------------------------
isam@wasach 1001: cd javaLab/tiger/standard/
isam@wasach 1002: java jScrollBar
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0x420734c0, pid=13173, tid=1090456768
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-beta-b22 mixed mode)
# Problematic frame:
# C [libc.so.6+0x734c0] __libc_free+0x70
#
# An error report file with more information is saved as hs_err_pid13173.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/cgi-bin/bugreport.cgi
#
Aborted
isam@wasach 1003:
----------------------------------------------------------------------------------------
To reproduce bug:
1. Compile and run the following test case
2. Use the mouse to move the vertical scrollbar up and down
3. Use the mouse to move the horizontal scrollbar right and left
4. Use the keyboard Up, Down keys to move the vertical scrollbar up and down
5. Note that the test case does not respond to the keys
6. Use the keyboard Right and Left arrows to move the horizontal scrollbar right and left
7. Note that the test case does not respond to the keys
----------------------------------------------------------------------
/* Copyright (c) Sun Microsystems 1998
$Header: /home-bazelet/sun/src/javaLab/JDK1.4/standard/jScrollBar.java,v 1.2 2001/08/20 11:19:43 isam Exp $
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class jScrollBar extends JApplet
{
public void init()
{
ScrollBarExample sbe = new ScrollBarExample();
getContentPane().add(sbe);
}
public static void main(String[] argv)
{
JFrame frame = new JFrame("ABCDEFG");
frame.setContentPane(new ScrollBarExample());
frame.setSize(300,300);
frame.setVisible(true);
frame.addWindowListener( new WindowAdapter()
{
public void windowClosing( WindowEvent e)
{
System.exit(0);
}
});
}
}
class ScrollBarExample extends JPanel
{
JPanel p;
JLabel label;
public ScrollBarExample()
{
super(true);
label=new JLabel();
label.setFont(new Font("Lucida Sans Regular",Font.PLAIN,14));
setLayout(new BorderLayout());
JScrollBar hbar=new JScrollBar(JScrollBar.HORIZONTAL, 30, 20, 0, 300);
JScrollBar vbar=new JScrollBar(JScrollBar.VERTICAL, 30, 40, 0, 300);
hbar.setUnitIncrement(2);
hbar.setBlockIncrement(1);
hbar.addAdjustmentListener(new MyAdjustmentListener());
vbar.addAdjustmentListener(new MyAdjustmentListener());
setBackground(Color.white);
add(hbar, BorderLayout.SOUTH);
add(vbar, BorderLayout.EAST);
add(label, BorderLayout.CENTER);
}
class MyAdjustmentListener implements AdjustmentListener
{
public void adjustmentValueChanged(AdjustmentEvent e)
{
label.setText("\u0627\u0644\u0642\u064a\u0645\u0629\u0020\u0627\u0644\u062c\u062f\u064a\u062f\u0629 " + e.getValue() + " ");
repaint();
}
}
}
----------------------------------------------------------------------
======================================================================