From 3ab009dc5bb7c8ebe885741638c0ec4ee817887a Mon Sep 17 00:00:00 2001 From: weisj <31143295+weisJ@users.noreply.github.com> Date: Thu, 5 Aug 2021 12:35:23 +0200 Subject: [PATCH] Set empty border on VisibleComponent VisibleComponent is a JInternalFrame but never used in a JDesktopPane. Darklaf adds a shadow border around the frame which looks odd in this case. Explicitly setting an empty border solves this issue. --- .../gui/components/VisibleComponent.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java index 813ef2e7..4c348673 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java @@ -3,8 +3,10 @@ package the.bytecode.club.bytecodeviewer.gui.components; import com.github.weisj.darklaf.icons.ThemedSVGIcon; import the.bytecode.club.bytecodeviewer.Configuration; import the.bytecode.club.bytecodeviewer.gui.resourceviewer.Workspace; +import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme; import the.bytecode.club.bytecodeviewer.resources.IconResources; +import javax.swing.BorderFactory; import javax.swing.JInternalFrame; /*************************************************************************** @@ -40,7 +42,16 @@ public abstract class VisibleComponent extends JInternalFrame super(title, false, false, false, false); this.setDefaultIcon(); } - + + @Override + public void updateUI() { + if (Configuration.lafTheme != LAFTheme.SYSTEM) + setBorder(BorderFactory.createEmptyBorder()); + else + setBorder(null); + super.updateUI(); + } + public void setDefaultIcon() { try {