From d5e54e07f93b03497c8a2357fe76edb1403b09ee Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 6 Jun 2017 21:00:17 +0800 Subject: [PATCH] bug fix --- .../mainframe/alphafine/model/SearchListModel.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/model/SearchListModel.java b/designer/src/com/fr/design/mainframe/alphafine/model/SearchListModel.java index f030f2240c..2f3dd48c0f 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/model/SearchListModel.java +++ b/designer/src/com/fr/design/mainframe/alphafine/model/SearchListModel.java @@ -14,7 +14,9 @@ public class SearchListModel extends DefaultListModel { @Override public void addElement(Object element) { + int index = myDelegate.size(); myDelegate.add(element); + fireContentsChanged(this, index, index); } @Override @@ -23,13 +25,17 @@ public class SearchListModel extends DefaultListModel { } @Override - public void insertElementAt(Object element, int index) { - this.myDelegate.add(index, element); + public void add(int index, Object element) { + myDelegate.add(index, element); + fireIntervalAdded(this, index, index); } @Override - public void removeElementAt(int index) { - this.myDelegate.remove(index); + public Object remove(int index) { + Object object = myDelegate.get(index); + myDelegate.remove(object); + fireIntervalRemoved(this, index, index); + return object; } @Override