From eaeffb57140b57bdcb0ed2edee5b37dd927f46bb Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 16 Dec 2020 17:51:56 +0800 Subject: [PATCH] =?UTF-8?q?CHART-17231=20=E9=BB=98=E8=AE=A4=E4=B8=8D?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E4=BB=BB=E4=BD=95=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/extended/chart/UIComboBoxWithNone.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java index 65e7bbb43..9c6636fd7 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java @@ -23,7 +23,11 @@ public class UIComboBoxWithNone extends UIComboBox { } protected void setDefaultSelectedItem() { - setSelectedItem(StringUtils.EMPTY); + // JComboBox.setSelectedItem(o) + // if(o!=null)寻找o对应的下拉选项 如果找不到 还是选中之前选中的 + // 所以空字符串 不是选中空 是选中上次选中的 + // 所以这边 可以写setSelectedItem(null) or setSelectedIndex(-1) + setSelectedIndex(-1); } @Override