Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Thread Safe BufferedImage Drawing

843806Oct 4 2007 — edited Oct 8 2007
Hi. 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 5 2007
Added on Oct 4 2007
5 comments
274 views