From 5a490cf8dd753d983b46edc2d1b8fc8c96e2bd13 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Mon, 19 Jun 2017 13:53:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=EF=BC=9A=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E6=98=BE=E7=A4=BA=E9=87=8C=E8=AE=BE=E7=BD=AE=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=86=85=E5=AE=B9=E4=B8=BA=E6=95=B0=E6=8D=AE=E5=88=97?= =?UTF-8?q?=EF=BC=8C=E6=8A=8A=E5=AF=B9=E5=BA=94=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=88=A0=E6=8E=89=E5=90=8E=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=9A=84=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=EF=BC=8C=E9=A1=B5=E9=9D=A2=E6=89=93=E4=B8=8D=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/editor/ColumnSelectedEditor.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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 0f1c50a5f..29b1a3ea0 100644 --- a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -36,15 +36,18 @@ 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++) { - columnNameComboBox.addItem(columnNames[i]); + TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem(); + if (tableDataWrapper != null) { + //这边需要重新初始化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++) { + columnNameComboBox.addItem(columnNames[i]); + } + columnNameComboBox.validate(); } - columnNameComboBox.validate(); } }); columnNameComboBox = new UIComboBox();