RootPane: uninstall background, foreground and font because not all Lafs set them

This commit is contained in:
Karl Tauber
2022-01-10 11:58:49 +01:00
parent 6d705e568a
commit e8ee037d09

View File

@@ -161,6 +161,19 @@ public class FlatRootPaneUI
c.putClientProperty( "jetbrains.awt.windowDarkAppearance", FlatLaf.isLafDark() );
}
@Override
protected void uninstallDefaults( JRootPane c ) {
super.uninstallDefaults( c );
// uninstall background, foreground and font because not all Lafs set them
if( c.isBackgroundSet() && c.getBackground() instanceof UIResource )
c.setBackground( null );
if( c.isForegroundSet() && c.getForeground() instanceof UIResource )
c.setForeground( null );
if( c.isFontSet() && c.getFont() instanceof UIResource )
c.setFont( null );
}
@Override
protected void installListeners( JRootPane root ) {
super.installListeners( root );