In JScrollBar we are multiplying the unit and block increment which is
wrong and leads to the JScrollBar not scrolling up at all.

2007-03-27  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/JScrollBar.java
        (getUnitIncrement(int)): Don't multiply direction parameter.
        (getBlockIncrement(int)): Don't multiply direction parameter.

/Roman

-- 
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0

USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt
Index: javax/swing/JScrollBar.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JScrollBar.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -1 -5 -r1.17 -r1.18
--- javax/swing/JScrollBar.java	21 Sep 2006 10:04:26 -0000	1.17
+++ javax/swing/JScrollBar.java	27 Mar 2007 09:01:47 -0000	1.18
@@ -359,61 +359,61 @@
       model.addChangeListener(sbChangeListener);
     firePropertyChange("model", oldModel, model);
   }
 
   /**
    * This method returns how much the scrollbar's value
    * should change for a unit increment depending on the 
    * given direction.
    *
    * @param direction The direction to scroll in.
    *
    * @return The amount the scrollbar's value will change given the direction.
    */
   public int getUnitIncrement(int direction)
   {
-    return direction * unitIncrement;
+    return unitIncrement;
   }
 
   /**
    * This method sets the unitIncrement property.
    *
    * @param unitIncrement The new unitIncrement.
    */
   public void setUnitIncrement(int unitIncrement)
   {
     if (unitIncrement != this.unitIncrement)
       {
 	int oldInc = this.unitIncrement;
 	this.unitIncrement = unitIncrement;
 	firePropertyChange("unitIncrement", oldInc,
 	                   this.unitIncrement);
       }
   }
 
   /**
    * The method returns how much the scrollbar's value
    * should change for a block increment depending on
    * the given direction.
    *
    * @param direction The direction to scroll in.
    *
    * @return The amount the scrollbar's value will change given the direction.
    */
   public int getBlockIncrement(int direction)
   {
-    return direction * blockIncrement;
+    return blockIncrement;
   }
 
   /**
    * This method sets the blockIncrement property.
    *
    * @param blockIncrement The new blockIncrement.
    */
   public void setBlockIncrement(int blockIncrement)
   {
     if (blockIncrement != this.blockIncrement)
       {
 	int oldInc = this.blockIncrement;
 	this.blockIncrement = blockIncrement;
 	firePropertyChange("blockIncrement", oldInc,
 	                   this.blockIncrement);

Reply via email to