I have a JComboBox whose values are retrieved across the net.
I'm looking for a way to indicate that fact to the user, when the user wants to see the list, expands the drop down, and only then the data is being retrieved.
The basic requirements include:
- JComboBox's drop-down shouldn't lock the EDT, but the combo's action should not work until there are values.
- User should know when all data has been retrieved.
- The size (UI real-estate) of the indication should be as small as possible.
Note that the data isn't retrieved until the user wants to see the combo's values (i.e. expands the drop-down list).
The solution i've used:
I've used a SwingWorker
to keep the UI responsive. The combo box was overlayed using JIDE's Overlayable
with JIDE's InfiniteProgressPanel
that listens to the worker.