Integrated: 6318027: BasicScrollBarUI does not disable timer when enclosing frame is disabled.

Prasanta Sadhukhan psadhukhan at openjdk.org
Wed Aug 21 07:07:12 UTC 2024


On Fri, 26 Jul 2024 06:03:28 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> Issue is
> BasicScrollBarUI.ArrowButtonListener starts a timer in mousePressed(), and stops it in mouseReleased(). If the frame containing the scrollbar is disabled between the MOUSE_PRESSED and the MOUSE_RELEASED events, the mouseReleased() method is never called. If the frame is then re-enabled, the still-running timer causes it to scroll all the way to the end.
> Fix is to check if [ArrowButtonListener.handledEvent](https://github.com/openjdk/jdk/blame/ee839b7f0ebe471d3877cddd2c87019ccb8ee5ae/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java#L1567) is still set when ActionEvent is processed then stop the timer and reset this variable.
> 
> CI testing is green and also SwingSet2 JScrollPane scrolling with this modification..

This pull request has now been integrated.

Changeset: cafb3dc4
Author:    Prasanta Sadhukhan <psadhukhan at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/cafb3dc49157daf12c1a0e5d78acca8188c56918
Stats:     260 lines in 3 files changed: 247 ins; 0 del; 13 mod

6318027: BasicScrollBarUI does not disable timer when enclosing frame is disabled.

Reviewed-by: abhiscxk, tr

-------------

PR: https://git.openjdk.org/jdk/pull/20346


More information about the client-libs-dev mailing list