I'm getting this exception when deleting an item from any Jlist, Exception in thread "AWT-EventQueue-0" java.util.ConcurrentModificationException, i have a JButton "Remove", whenever i pressed this remove button, it enters into a method that iterates thru an ArrayList containing all the objects in the list, the exception is thrown but still the element gets removed. how can i solve this?.
Don't know. Sorry. What are you passing to the JList constructor? It takes an array, ListModel, or Vector, not an ArrayList directly. Why do you need an Iterator to remove it from the backing Collection? You can get the elementAt() or selectedElement() from a JLIst, but the API says it creates a read-only ListModel if you create the JList from an array or Vector.
People might be better able to help with more details and a code snippet. [ June 23, 2008: Message edited by: Campbell Ritchie ]