List newEntries = new ArrayList();
for (int i = 0; i < listModel.getSize(); i++) {
newEntries.add(listModel.getElementAt(i));
}
BrowserConfig config = frame.getConfig();
List oldEntries = new ArrayList(config.getClasspath());
Iterator itOld = oldEntries.iterator();
while (itOld.hasNext()) {
ClasspathEntry entry = (ClasspathEntry)itOld.next();
if (!newEntries.contains(entry)) {
config.removeClasspathEntry(entry);
}
}
Iterator itNew = newEntries.iterator();
while (itNew.hasNext()) {
ClasspathEntry entry = (ClasspathEntry)itNew.next();
if (!oldEntries.contains(entry)) {
config.addClasspathEntry(entry);
}
}
config.setClasspath(newEntries);
setVisible(false);
}