RFR: 6318027: BasicScrollBarUI does not disable timer when enclosing frame is disabled. [v6]

Prasanta Sadhukhan psadhukhan at openjdk.org
Tue Aug 20 06:38:12 UTC 2024


> 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..

Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:

  Formatting

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20346/files
  - new: https://git.openjdk.org/jdk/pull/20346/files/de7ad6b7..612b3ce7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20346&range=05
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20346&range=04-05

  Stats: 9 lines in 3 files changed: 3 ins; 2 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/20346.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20346/head:pull/20346

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


More information about the client-libs-dev mailing list