From a5e2073f16d9158a4ac22bf8f9cb8f179723b6ac Mon Sep 17 00:00:00 2001 From: xiaohu Date: Sun, 12 Jun 2016 11:11:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=87=8D=E6=96=B0=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=88=97=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/editor/ColumnSelectedEditor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java index b3997c1b19..da726b4646 100644 --- a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -13,6 +13,8 @@ import com.fr.stable.StringUtils; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.*; +import java.util.List; import java.util.regex.Pattern; /** @@ -35,6 +37,9 @@ public class ColumnSelectedEditor extends Editor { @Override public void itemStateChanged(ItemEvent e) { + //這邊需要重新初始化columnNames, 否則nameList長度和columnNames長度不同導致出錯。 + List nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); + columnNames = new String[nameList.size()]; columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); columnNameComboBox.removeAllItems(); for (int i = 0; i < columnNames.length; i++) { From 30a159a114fe836d253066c7f80360a719d2156d Mon Sep 17 00:00:00 2001 From: xiaohu Date: Sun, 12 Jun 2016 11:18:35 +0800 Subject: [PATCH 2/2] update --- .../src/com/fr/design/editor/editor/ColumnSelectedEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java index da726b4646..62f829aaf1 100644 --- a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -37,7 +37,7 @@ public class ColumnSelectedEditor extends Editor { @Override public void itemStateChanged(ItemEvent e) { - //這邊需要重新初始化columnNames, 否則nameList長度和columnNames長度不同導致出錯。 + //这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。 List nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); columnNames = new String[nameList.size()]; columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames);