From 91dbd8fc78b884e540d2a9caf77914aa00aa3cef Mon Sep 17 00:00:00 2001 From: weisj Date: Sun, 25 Oct 2020 15:45:57 +0100 Subject: [PATCH] Ensure the JSpinners editor uses zero-size margins. --- .../com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java b/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java index 3d01b821..65a6c495 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/spinner/DarkSpinnerUI.java @@ -30,6 +30,7 @@ import javax.swing.border.EmptyBorder; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.basic.BasicSpinnerUI; +import javax.swing.text.JTextComponent; import com.github.weisj.darklaf.components.ArrowButton; import com.github.weisj.darklaf.ui.DividedWidgetPainter; @@ -145,6 +146,9 @@ public class DarkSpinnerUI extends BasicSpinnerUI implements SpinnerConstants { } else { editorComponent = editor; } + if (editorComponent instanceof JTextComponent) { + ((JTextComponent) editorComponent).setMargin(new Insets(0, 0, 0, 0)); + } editorComponent.addFocusListener(spinnerListener); }