I am using DefaultComboBoxModel to manage the data for various JComboBoxes in my app.
I would like to disable these comboboxes while the data is loading or reloading (or display a “loading…” text and set the pointer to a hourglass).
Is there a way for the JComboBox to be informed that the model is reloading the data ?
The reloading is occuring in a separate thread.
In the
AbstractListModelis a function calledaddListDataListener(ListDataListener l). Now you are able to implement your own Listener that will be informed when the methodfireContentsChanged(Object source, int index0, int index1)is called (This will be done in background, you don’t need to do this).AbstractListModel