JDK-6281415 : REGRESSION: Unable To Scroll On A ScrollPane After Migrating To JAVA 1.5
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2005-06-07
  • Updated: 2010-04-02
  • Resolved: 2005-06-07
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
The java version for each of the mentioned platforms are:
+ Solaris 5.8 : 1.5.0_01
+ Linux 2.6.11 : 1.5.0_02
+ Window XP : 1.5.0

ADDITIONAL OS VERSION INFORMATION :
The problem is reproducible on a test driver in all three platforms:
+ Solaris 5.8
+ Linux 2.6.11
+ Window XP

A DESCRIPTION OF THE PROBLEM :
I have an application that uses JScrollPane to scroll a list.  The JScrollPane is on a JPane, which is on a JMenu.  The JMenu is in turn, on a JMenuBar.  The application works fine with JAVA 1.4.  However, after migrating to JAVA 1.5, I am no longer able to scroll the list.  When the down arrow on the scroll bar is pressed, the scroll knob goes all the way to the bottom of the list.  When the up arrow of the scroll bar is pressed, the reverse takes place.  I am also no longer to drag/move/release the scroll knob on the scroll bar.  This behavior is repeatable with a simple driver (See source code below) in all three platforms documented above.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
+ Compile and run the test driver below
+ When the ui pops up, try to
   ++ Click the up arrow  on the scroll bar, then release the arrow
   ++ Click the down arrow on the scroll bar, then release the arrow
   ++ Drag on the knob on the scroll bar and attempt to move it up/down
         the scroll bar.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected Result:
++ Scroll pane should move the list up if you press the up arrow, but should stop moving after you releasing the arrow.
++ Scroll pane should move the list down if you press the down arrow, but should stop moving after you releasing the arrow.
++ Scroll pane should move the list according to the direction you move your scroll knob.
ACTUAL -
Actual Result:
++  Scroll pane will go all the way to the top of the list after you press the up arrow once.  The release of the arrow key does nothing to stop the scrolling.
++ Scroll pane will go all the way to the bottom of the list after you press the down arrow once.  The release of the arrow key does nothing to stop the scrolling.
++ Unable to drag/move/release the knob on the scroll bar.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
package test;
 
import javax.swing.*;
 
public class  Example {
 
   public JPanel createPanel() {
      JList itemList = new JList(mItems);
      JScrollPane scrollPane = new JScrollPane();
      scrollPane.setViewportView(itemList);
      JPanel panel = new JPanel();
      panel.add(scrollPane);
      return panel;
   }
 
   public JMenu createMenu() {
      JMenu menu = new JMenu("my_menu");
      menu.add(createPanel());
      return menu;
   }
 
   public JMenuBar createMenuBar() {
      JMenuBar menuBar = new JMenuBar();
      menuBar.add(createMenu());
      return menuBar;
   }
 
   public static void main(String[] args) {
      Example test = new Example();
      JFrame frame = new JFrame("my_frame");
      frame.getContentPane().add(test.createMenuBar());
      frame.pack();
      frame.validate();
      frame.setVisible(true);
   }
 
   private static String[] getItems() {
      int arrayLength = 100;
      String[] stringArray = new String[arrayLength];
      for (int i = 0; i < arrayLength; i++) {
         stringArray[i] = new String("String_" + i);
      }
      return stringArray;
   }
 
  private static String[] mItems = getItems();
 
}
 

---------- END SOURCE ----------

Release Regression From : 1.4.2_05
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.
###@###.### 2005-06-07 08:44:49 GMT

Comments
EVALUATION This bug caused by the same reasons as 5036146. Closing as duplicate. ###@###.### 2005-06-07 09:02:56 GMT
07-06-2005