diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/internalframe/DarkInternalFrameBorder.java b/core/src/main/java/com/github/weisj/darklaf/ui/internalframe/DarkInternalFrameBorder.java index 4777669a1..6f0089b3c 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/internalframe/DarkInternalFrameBorder.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/internalframe/DarkInternalFrameBorder.java @@ -52,7 +52,7 @@ public DarkInternalFrameBorder() { @Override public void paintBorder(final Component c, final Graphics graphics, final int x, final int y, final int width, final int height) { - if (c instanceof JInternalFrame && ((JInternalFrame) c).isMaximum()) { + if (shouldHideShadow(c)) { return; } updateOpacity(c); @@ -69,10 +69,17 @@ protected void updateOpacity(final Component c) { @Override public Insets getBorderInsets(final Component c) { - if (c instanceof JInternalFrame && ((JInternalFrame) c).isMaximum()) { + if (shouldHideShadow(c)) { return new InsetsUIResource(0, 0, 0, 0); } updateOpacity(c); return super.getBorderInsets(c); } + + private boolean shouldHideShadow(final Component c) { + if (!(c instanceof JInternalFrame) || ((JInternalFrame) c).isMaximum()) { + return true; + } + return !(c.getParent() instanceof JDesktopPane); + } }