diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java index 36dc760f..3dc1e6f3 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/button/DarkButtonUI.java @@ -28,7 +28,6 @@ import java.awt.*; import java.awt.geom.RoundRectangle2D; import javax.swing.*; -import javax.swing.border.Border; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicButtonListener; @@ -286,8 +285,7 @@ public class DarkButtonUI extends BasicButtonUI implements ButtonConstants { } protected boolean shouldDrawBackground(final AbstractButton c) { - Border border = c.getBorder(); - return c.isEnabled() && border != null && button.isContentAreaFilled(); + return button.isContentAreaFilled(); } protected int getArc(final Component c) { diff --git a/core/src/test/java/ui/button/AbstractButtonDemo.java b/core/src/test/java/ui/button/AbstractButtonDemo.java index 7646d343..e60e549a 100644 --- a/core/src/test/java/ui/button/AbstractButtonDemo.java +++ b/core/src/test/java/ui/button/AbstractButtonDemo.java @@ -106,6 +106,18 @@ public abstract class AbstractButtonDemo implements Co addActionListener(e -> button.setContentAreaFilled(isSelected())); } }); + controlPanel.add(new JCheckBox("Border painted") { + { + setSelected(button.isBorderPainted()); + addActionListener(e -> button.setBorderPainted(isSelected())); + } + }); + controlPanel.add(new JCheckBox("Focus Painted") { + { + setSelected(button.isFocusPainted()); + addActionListener(e -> button.setFocusPainted(isSelected())); + } + }); controlPanel.add(new JCheckBox("Button.defaultButtonFollowsFocus") { { setSelected(UIManager.getBoolean("Button.defaultButtonFollowsFocus"));