On Fri, 3 Jan 2025 15:02:13 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

> > I wonder if such a customisation is supported. Synth and Nimbus don't 
> > always use the `UIMaganager` to set the defaults. Perhaps, these 
> > Look-and-Feels should be excluded from this test.
> > On the other hand, Swing usually allows such customisations and respects 
> > settings in `UIManger`… but doing so in Synth and Nimbus often looks 
> > inconsistent and requires special handling of UI-delegate classes.
> 
> I thought about ignoring this property for Synth and probably close "Not an 
> issue" but I could not find in spec of not honoring UIManager properties in 
> Synth so added this fix...I guess we can argue for both for and against of 
> adding this support in Synth but since it's pretty early in jdk25 mainline so 
> any problem arising out of this can be tackled before the final release..

What I don't like with the current approach is that we'll need to add an 
`instanceof` for each component to support customisation. If `UIManager` 
properties should be honoured, `SynthContext`, `SynthStyle` or whatever holds 
the defaults should look up properties in `UIManager` too. The [`SynthStyle` 
class](https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/plaf/synth/SynthStyle.html)
 represents “a set of style properties.” It loads the defaults from a synth 
file…

Anyway, it's out of scope for the current fix. If it's a one-off fix for one 
component, it's okay to handle it this way. Yet if the number of components 
and/or properties grows, we should rethink how Synth-based look-and-feels can 
be customised via `UIManager` just like all other L&Fs.

>> test/jdk/javax/swing/JOptionPane/bug4174551.java line 26:
>> 
>>> 24: /*
>>> 25:  * @test
>>> 26:  * @bug 4174551 8346260
>> 
>> Should the test exercise all available Look and Feels?
>
> SInce it's manual test, I guess this will make it more complex..its good as 
> it is..

Fair enough.

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

PR Comment: https://git.openjdk.org/jdk/pull/22908#issuecomment-2569753058
PR Review Comment: https://git.openjdk.org/jdk/pull/22908#discussion_r1902125579

Reply via email to