<Swing Dev> Review request for JDK-8075084 JOptionPane.showMessageDialog causes JScrollBar to move

Rajeev Chamyal rajeev.chamyal at oracle.com
Wed Nov 11 15:47:45 UTC 2015


Hello All,

 

Please review the following fix for Jdk9:
 
Bug: https://bugs.openjdk.java.net/browse/JDK-8075084

Webrev: http://cr.openjdk.java.net/~rchamyal/8075084/webrev.00/

Issue: On running the sample program attached in bug JDK-8075084 user is expected to see a scrollbar and on clicking the scrollbar tracker or scrollbar up/down arrow buttons a JOption dialog should come once. The program works fine if scrollbar tracker is clicked i.e. JOption dialog comes only once. But on clicking up/down arrow buttons of scrollbar the JOption dialog keeps on coming repeatedly.

 

Cause: The mouse pressed event of scrollbar arrow buttons calls BasicScrollBarUI::scrollByUnit method which creates a property change event and calls scroll bar action listener which again calls BasicScrollBarUI::scrollByUnit. This is becoming a recursive call and causing the scrollbar slider to move repeatedly till it reaches the other end of scrollbar.
 
Fix: Added checks in the BasicScrollBarUI action listener to stop the recursion.
 
Regards,
Rajeev Chamyal

 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20151111/8b3210e1/attachment.html>


More information about the swing-dev mailing list