Hello,

I'm coding a Swing application that has a huge component being redrawn every few seconds, and I'd like to display a small progress dialog on top of it, to allow the user to know what's going on and maybe cancel the drawing. It's working most of the time, but sometimes the component being drawn in the main window takes too much time to draw so that the small dialog becomes unresponsive and doesn't update. I'd like to make the main drawing thread have a lower priority, but I've tried invoking Thread.currentThread().setPriority(Thread.MIN_PRIORITY) inside the paintComponent() method, and it didn't work. I believe it is due to the fact that both components are being drawn by the same thread, since Swing is monothreaded. In this case, how could I do it? Creating a SwingWorker thread to render the large component somewhere else, and only then updating? Or is there a simpler way of doing it?