diff --git a/zap/src/main/java/org/parosproxy/paros/extension/option/OptionsParamView.java b/zap/src/main/java/org/parosproxy/paros/extension/option/OptionsParamView.java index b1dc110f2b7..4262a11fda3 100644 --- a/zap/src/main/java/org/parosproxy/paros/extension/option/OptionsParamView.java +++ b/zap/src/main/java/org/parosproxy/paros/extension/option/OptionsParamView.java @@ -669,11 +669,10 @@ public void setLookAndFeelInfo(LookAndFeelInfo lookAndFeelInfo) { e -> { try { UIManager.setLookAndFeel(lookAndFeelInfo.getClassName()); - Arrays.asList(Window.getWindows()).stream() - .forEach(SwingUtilities::updateComponentTreeUI); - View.getSingleton() - .getPopupList() - .forEach(SwingUtilities::updateComponentTreeUI); + updateUiComponentTree(); + // A second pass is needed to ensure all components; + // trees in particular, are updated. + updateUiComponentTree(); } catch (Exception e2) { LOGGER.warn( "Failed to set the look and feel: {}", @@ -690,6 +689,11 @@ public void setLookAndFeelInfo(LookAndFeelInfo lookAndFeelInfo) { } } + private static void updateUiComponentTree() { + Arrays.stream(Window.getWindows()).forEach(SwingUtilities::updateComponentTreeUI); + View.getSingleton().getPopupList().forEach(SwingUtilities::updateComponentTreeUI); + } + public boolean isScaleImages() { return scaleImages; }