On Tue, 19 Aug 2025 20:12:40 GMT, Phil Race <[email protected]> wrote:

>> This refactors some Swing code to pass args instead of using statics
>> The bug report suggests some further refactoring which could be considered 
>> later, but the most
>> important thing to do is to eliminate using statics to pass args.
>> I've added one other suggestion from the bug report to have the windows case 
>> call SU3 directly rather than via newly added static methods, but for the 
>> basic case, I left the pre-existing private instance methods.
>
> Phil Race has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8365389

> > Your latest commit 
> > [1b67651](https://github.com/openjdk/jdk/commit/1b676514010e55d0903ba445e5dd806e9f1b862d)
> >  doesn't address the problem fully, you should also remove 
> > `WindowsMenuItemUI.installDefaults`.
> 
> Shouldn't we keep it in WIndowMenuItemUI as in BasicLookAndFeel the fields 
> are initialized as …  whereas in WIndowsLookAndFeel it is …


@prsadhuk No, we shouldn't. These are the values assigned to the properties in 
`UIManager`. When you get the property from `UIManager`, you get the value 
that's there whether it's the default value of a look-and-feel or a customised 
value by app developer.

Either way, both `WindowMenuItemUI` and `BasicMenuItemUI` read the same values, 
the `WindowsMenuItemUI.installDefaults` repeats the actions that 
`BasicMenuItemUI` already did for it.

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

PR Comment: https://git.openjdk.org/jdk/pull/26783#issuecomment-3229698455

Reply via email to