RFR: 8286620: Create regression test for verifying setMargin() of JRadioButton [v3]

Tejesh R duke at openjdk.java.net
Wed Jun 1 05:40:29 UTC 2022


On Tue, 31 May 2022 11:15:25 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Tejesh R has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Updated based on review comments
>>  - Added headful key
>
> test/jdk/javax/swing/JRadioButton/bug4380543.java line 106:
> 
>> 104: 
>> 105:             lookAndFeelMaps.put(sMapKey, sLnF);
>> 106:         }
> 
> Suggestion:
> 
>         for (UIManager.LookAndFeelInfo look : lookAndFeel) {
>             lookAndFeelMaps.put(look.getName(), look.getClassName());
>         }
> 
> 
> I guess I mentioned it earlier. I think this way is cleaner and more user-friendly: the user will see the name of the Look and Feel rather than part of its class name.
> 
> The local variables `sLnF` and `sMapKey` declared above the look become unnecessary in this case.
> 
> If you use `LinkedHashMap`, the order of the L&Fs will be preserved the map will be iterated for creating the buttons.

The reason for doing this was to use the same key for button creation (name of button) and then to link that with the button action, so changing this will affect other logics.

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

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



More information about the client-libs-dev mailing list