I have a table with a custom cell renderer made from a custom component that includes a JLabel with an ImageIcon. The images for the ImageIcons have to be downloaded from Amazon Web Services, and this takes awhile. I'd like the textual parts of the custom component to display right away, and the images to be added as they become available. But the obvious way of handling this (start a background thread to download the image; update the JLabel when it completes) doesn't work, presumably because of the peculiar way custom renderers are handled (same renderer used for multiple cells, so that renderer.repaint() does nothing).
Currently I am just getting the image and updating the JLabel with it in the custom component's getTableCellRendererComponent() method. This means that all the images are downloaded before any of the table's cells are painted.
I've spent a fair while struggling with this; I'd be very interested to learn what the solution might be, if there is one. Thanks!