diff --git a/CHANGELOG.md b/CHANGELOG.md index 1050dcf2..e913ef5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ FlatLaf Change Log components by: - `2px` at `1.75x` in **Light** and **Dark** themes - `2px` at `1.25x` and `2.25x` in **IntelliJ** and **Darcula** themes +- OptionPane: Do not make child components, which are derived from `JPanel`, + non-opaque. (issue #349) ## 1.3 diff --git a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatOptionPaneUI.java b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatOptionPaneUI.java index b8e7bb20..f7632e33 100644 --- a/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatOptionPaneUI.java +++ b/flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatOptionPaneUI.java @@ -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 ); - } } }