I have a bounded ListModel which I pass to FilteredListModel. Then I create a JList using this FilteredListModel. The problem is when the Form object gets set, ListModel changes but filter model is not getting updated?
Here is what I am trying to do,
I think the problem is in FilteredListModelCode:final ListListModel listModel = (ListListModel)getFormModel().createBoundListModel(GlobalUser.AVAILABLE_ROLES_PROPERTIES); final FilteredListModel filteredModel = new FilteredListModel(listModel, new Constraint() { public boolean test(Object object) { if (object instanceof Role) { return!getSelectedListModel().contains(object); } return false; } }); list.setModel(filteredModel);
Should beCode:public void contentsChanged(ListDataEvent e) { super.contentsChanged(e); }
Amad
Code:public void contentsChanged(ListDataEvent e) { reallocateIndexes(); super.contentsChanged(e); }


Reply With Quote