diff --git a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneUIBridge.java b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneUIBridge.java index e49a9020..9bc7a736 100644 --- a/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneUIBridge.java +++ b/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/DarkTabbedPaneUIBridge.java @@ -484,7 +484,7 @@ public abstract class DarkTabbedPaneUIBridge extends TabbedPaneUI implements Swi String clippedTitle = title; if (!scrollableTabLayoutEnabled() && isHorizontalTabPlacement()) { - clippedTitle = SwingUtilities2.clipStringIfNecessary(null, metrics, title, textRect.width); + clippedTitle = SwingUtil.clipStringIfNecessary(null, metrics, title, textRect.width); } paintText(g, tabPlacement, font, metrics, tabIndex, clippedTitle, textRect, isSelected); diff --git a/core/src/main/java/com/github/weisj/darklaf/util/SwingUtil.java b/core/src/main/java/com/github/weisj/darklaf/util/SwingUtil.java index a2943cdd..ca988f80 100644 --- a/core/src/main/java/com/github/weisj/darklaf/util/SwingUtil.java +++ b/core/src/main/java/com/github/weisj/darklaf/util/SwingUtil.java @@ -52,6 +52,15 @@ public final class SwingUtil { SwingUtilities2.setSkipClickCount(comp, count); } + public static int stringWidth(final JComponent c, final FontMetrics fm, final String string) { + return SwingUtilities2.stringWidth(c, fm, string); + } + + public static String clipStringIfNecessary(final JComponent c, final FontMetrics fm, + final String string, int availTextWidth) { + return SwingUtilities2.clipStringIfNecessary(c, fm, string, availTextWidth); + } + public static FontMetrics getFontMetrics(final JComponent c, final Graphics g) { if (g == null) throw new IllegalArgumentException("Graphics must not be null"); return getFontMetrics(c, g.getFont()); @@ -66,10 +75,6 @@ public final class SwingUtil { return c.getFontMetrics(font); } - public static int stringWidth(final JComponent c, final FontMetrics fm, final String string) { - return SwingUtilities2.stringWidth(c, fm, string); - } - public static boolean shouldIgnore(final MouseEvent me, final JComponent c) { return c == null || !c.isEnabled() || !SwingUtilities.isLeftMouseButton(me)