From d122d2da2a477ab5e733963d9330be256cc80fa2 Mon Sep 17 00:00:00 2001 From: Janmm14 Date: Sat, 21 Aug 2021 22:03:16 +0200 Subject: [PATCH] Add border to output window when theme is DarkLaf DarkLaf scrollbars are so thin that you only have very few pixels to grab the scrollbar with the mouse, otherwise you get to resize the window. --- .../com/javadeobfuscator/deobfuscator/ui/SwingWindow.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/java/com/javadeobfuscator/deobfuscator/ui/SwingWindow.java b/src/java/com/javadeobfuscator/deobfuscator/ui/SwingWindow.java index b352338..6836eb7 100644 --- a/src/java/com/javadeobfuscator/deobfuscator/ui/SwingWindow.java +++ b/src/java/com/javadeobfuscator/deobfuscator/ui/SwingWindow.java @@ -1,5 +1,6 @@ package com.javadeobfuscator.deobfuscator.ui; +import java.awt.Color; import java.awt.Dialog; import java.awt.Dimension; import java.awt.FlowLayout; @@ -32,6 +33,7 @@ import java.util.stream.IntStream; import javax.swing.*; +import javax.swing.border.MatteBorder; import javax.swing.border.TitledBorder; import com.github.weisj.darklaf.LafManager; @@ -971,7 +973,11 @@ public void keyPressed(KeyEvent event) JFrame newFrame = new JFrame(); newFrame.setTitle("Console"); area.setEditable(false); - newFrame.getContentPane().add(new JScrollPane(area)); + JScrollPane outputScrollPane = new JScrollPane(area); + if (enableDarkLaf.getState()) { + outputScrollPane.setBorder(new MatteBorder(0, 8, 8, 8, Color.DARK_GRAY)); + } + newFrame.getContentPane().add(outputScrollPane); newFrame.pack(); newFrame.setSize(800, 600); newFrame.setVisible(true);