OptionPane: do not make child components, which are derived from JPanel, non-opaque (issue #349)

This commit is contained in:
Karl Tauber
2021-07-07 10:57:54 +02:00
parent 4cdc995a7f
commit a28f701e6f
2 changed files with 4 additions and 3 deletions

View File

@@ -165,7 +165,7 @@ public class FlatOptionPaneUI
private void updateChildPanels( Container c ) {
for( Component child : c.getComponents() ) {
if( child instanceof JPanel ) {
if( child.getClass() == JPanel.class ) {
JPanel panel = (JPanel)child;
// make sub-panel non-opaque for OptionPane.background
@@ -177,9 +177,8 @@ public class FlatOptionPaneUI
panel.setBorder( new NonUIResourceBorder( border ) );
}
if( child instanceof Container ) {
if( child instanceof Container )
updateChildPanels( (Container) child );
}
}
}