From b3d1faf7e3d25f56a309cf88bdbeeb580b4215f4 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Wed, 4 Jul 2018 14:43:14 +0800 Subject: [PATCH] REPORT-9267 REPORT-9391 --- .../src/com/fr/design/gui/itextfield/UINumberField.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/com/fr/design/gui/itextfield/UINumberField.java b/designer-base/src/com/fr/design/gui/itextfield/UINumberField.java index d5b06509e..1ffb3c1dd 100644 --- a/designer-base/src/com/fr/design/gui/itextfield/UINumberField.java +++ b/designer-base/src/com/fr/design/gui/itextfield/UINumberField.java @@ -16,7 +16,7 @@ import java.awt.*; * Number Field. */ public class UINumberField extends UITextField { - public static final double ERROR_VALUE = Double.MAX_VALUE + 4.44; // peter:错误的值. + public static final double ERROR_VALUE = 0; // peter:错误的值. mata:如果输入负号之类直接走ERROR_VALUE public static final int MAX_INTEGERLENGTH = 24; public static final int MAX_INTEGERLENGTH_32 = 32; public static final int MAX_DECIMALLENGTH = 16; @@ -106,8 +106,8 @@ public class UINumberField extends UITextField { */ public double getValue() throws NumberFormatException { try { - //如果只输入了负号应该解释为0,而不是Double最大值 - if (this.getText().length() == 0 || "-".equals(this.getText())) { + + if (StringUtils.isEmpty(this.getText())) { return 0; }