I\'m subclassing JTable and using a DefaultTableModel to model my table data. The following class sets up the JTable, and adds one row to the model.
import
I ran on this issue too (with a JList and a DefaultListModel). Dmitry's answer is right.
However, there is another thing: this exception can also be thrown if you don't modify the model in Swing's Event Dispatch Thread.
Doing the following can help you avoid this exception:
SwingUtilities.invokeLater(new Runnable(){public void run(){
//Update the model here
}});
http://www.javakb.com/Uwe/Forum.aspx/java-gui/3012/JList-JScrollPane-DefaultListModel-Updating