Thread Safe BufferedImage Drawing
843806Oct 4 2007 — edited Oct 8 2007Hi. Im doing some lengthy rendering into a BufferedImage in a spawned off thread.
When the rendering reaches a certain point I want to paint the BI to a JPanel, wait
for the repaint to happen, and repeat about 3 times at which point the thread dies.
How do i wait for the JPanel to acutally draw the BufferedImage?
Do i use SwingUtilities.invokeAndWait(new Runnable(){ public void run(){ jpanel.repaint(); }})?
Ive never used SwingWorker but is this just the sort of task it was created for?
Thanks.