On Sun, 3 Aug 2025 06:23:08 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> wrote:
> > Isn't this just a bug ? I get zero from the test whenever "-1" is the > > direction - meaning scroll up - even if I use something like > > https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/JList.html#getScrollableUnitIncrement(java.awt.Rectangle,int,int) > > If the `visibleRect` Rectangle points to the 1st row or row 0 and we are > scrolling up i.e -1 direction there is no more space to scroll up so > `getScrollableUnitIncrement` returns 0. If we modify the testcase to have > `Rectangle cell = list.getCellBounds(data.length-1, data.length-1);` instead > of `list.getCellBounds(0, 0);` to point to last cell, it returns positive > number for -1 direction too As I wrote it returns zero for me no matter what. Eg if I use Rectangle cell = list.getCellBounds(1, 2); so why is that ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/26500#issuecomment-3160703976