On Fri, 27 Jan 2023 04:25:48 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> wrote:
>> Issue is observed that after changing the Look & Feel from Metal to Nimbus >> and back to Metal, the Nimbus font continues to be used by a JFileChooser. >> This is because Synth `installDefaults `methods set the font, but its >> inverse methods `uninstallDefaults `do not remove them. >> Fix is made to reset the font if it is set by L&F. > > Prasanta Sadhukhan has updated the pull request incrementally with one > additional commit since the last revision: > > Iterate all installed L&F test/jdk/javax/swing/JFileChooser/JFileChooserFontReset.java line 58: > 56: SwingUtilities.updateComponentTreeUI(fc); > 57: System.out.println("Nimbus font " + fc.getFont()); > 58: SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf)); This will test the uninstallDefaults for the Nimbus only. I think you need to iterate all L&F twice and for the different ones check that the font will be changed(if L&Fs use different fonts). ------------- PR: https://git.openjdk.org/jdk/pull/12180