From 8eda3e745d6421b3101164517b30ba2309ebd914 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 21 Jul 2020 14:49:52 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-35692=20=E5=9B=BD=E9=99=85=E5=8C=96-?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=AE=BE=E7=BD=AE-=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E6=94=B9=E4=B8=BAINCH=EF=BC=8C=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8=20=E6=96=B9=E6=B3=95=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/report/UnitFieldPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java index 9ad44562f3..6af6852d47 100644 --- a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java @@ -8,6 +8,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.stable.Constants; +import com.fr.stable.GraphDrawHelper; import com.fr.stable.OperatingSystem; import com.fr.stable.unit.CM; import com.fr.stable.unit.INCH; @@ -53,7 +54,7 @@ public class UnitFieldPane extends JPanel { } //自适应label宽度 - int width = this.getFontMetrics(this.getFont()).stringWidth(this.getText()); + int width = GraphDrawHelper.getWidth(this.getText(), this.getFont()); Dimension unitDimension = new Dimension(width, preferredHeight); this.setMinimumSize(unitDimension); this.setMinimumSize(unitDimension);