From 2d174d469fa74fd5cf5f35a0a83d5a3b4cf9a76a Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 4 Jan 2021 13:50:52 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-46421=20=E5=8F=96=E6=B6=88=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E5=90=8E=20=E6=B8=85=E7=A9=BA=E4=B8=8B=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/component/NumberEditorValidatePane.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java index ab4f7e4e2b..d77e1e9000 100644 --- a/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java +++ b/designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java @@ -150,7 +150,7 @@ public class NumberEditorValidatePane extends JPanel { setMaxListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected()); + refreshErrorMsgTip(); if (setMaxValueCheckBox.isSelected()) { maxValueSpinner.setEnabled(true); Double value = (double) 0; @@ -172,7 +172,7 @@ public class NumberEditorValidatePane extends JPanel { setMinListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected()); + refreshErrorMsgTip(); if (setMinValueCheckBox.isSelected()) { minValueSpinner.setEnabled(true); Double value = (double) 0; @@ -220,6 +220,14 @@ public class NumberEditorValidatePane extends JPanel { }; } + private void refreshErrorMsgTip() { + boolean visible = setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected(); + errorMsgTextFieldPane.setVisible(visible); + if (!visible) { + errorMsgTextField.setText(StringUtils.EMPTY); + } + } + public void populate(NumberEditor e) { allowDecimalsCheckBox.setSelected(e.isAllowDecimals()); if (e.isAllowDecimals()) {