// now synchronize the listBox
ListModelList lml = (ListModelList) listBoxSecGroups.getListModel();
// Check if the object is new or updated
// -1 means that the obj is not in the list, so it's new.
if (lml.indexOf(aGroup) == -1) {
lml.add(aGroup);
} else {
lml.set(lml.indexOf(aGroup), aGroup);
}