RFR: JDK-8282772: JButton text set as HTML content has unwanted padding [v2]

DamonGuy duke at openjdk.java.net
Mon May 9 16:15:50 UTC 2022


On Mon, 9 May 2022 06:04:05 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> DamonGuy has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Changed approach to fix.
>
> src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java line 394:
> 
>> 392:         Insets insets = SynthLookAndFeel.getPaintingInsets(ss, paintInsets);
>> 393: 
>> 394:         final View v = (View)c.getClientProperty(BasicHTML.propertyKey);
> 
> I guess this issue is only for JButton so is it needed to apply this for all components or we need to put a check for `c instance of JButton`

Wasn't completely sure if it was necessary to add the check since it passed without, meaning I wouldn't need to import JButton into this class. However, it does make sense to check for JButtons, so I made the change. Tested the change and everything still passes.

> test/jdk/javax/swing/JButton/HtmlButtonImageTest/HtmlButtonImageTest.java line 29:
> 
>> 27:  * @summary Tests HTML image as JButton text for unwanted padding on macOS Aqua LAF
>> 28:  * @run main HtmlButtonImageTest
>> 29:  */
> 
> I believe you have run this test on CI systems on all platforms

Thanks for catching that unedited summary. Fixed.

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

PR: https://git.openjdk.java.net/jdk/pull/8407



More information about the client-libs-dev mailing list