<Swing Dev> Minor copy/paste issue in BasicScrollBarUI ?

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Thu May 21 16:53:24 UTC 2020


This code snippet is part of the enhancement that has been added to 
support Nimbus L&F. It seems to be a bug as it is like this from initial 
commit for the enhancement.

You can raise a bug for this in JBS.

Regards
Prasanta
On 21-May-20 9:07 PM, Vicne wrote:
> Hi,
>
> I came across the following code in 
> javax.swing.plaf.basic.BasicScrollBarUI.installDefaults() :
>
>            if ("large".equals(scaleKey)){
>                 scrollBarWidth *= 1.15;
>                 incrGap *= 1.15;
>                 decrGap *= 1.15;
>             } else if ("small".equals(scaleKey)){
>                 scrollBarWidth *= 0.857;
>                 incrGap *= 0.857;
> *                decrGap *= 0.714;*
>             } else if ("mini".equals(scaleKey)){
>                 scrollBarWidth *= 0.714;
>                 incrGap *= 0.714;
>                 decrGap *= 0.714;
>             }
>
> There is no comment indicating a reason why decrGap is multiplied by 
> 0.714 - instead of 0.857 - in the second case, so I'd be tempted to 
> think it's a copy/paste error...
>
> What do you think ?
>
> KR,
>
>
>     Vicne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20200521/5283060e/attachment.htm>


More information about the swing-dev mailing list