Custom graphics repainting

I have a JPanel on which custom graphics are painted using Graphics2D.  Sometimes the graphics will take a few seconds to draw, but the JPanel is blank until everything has been drawn, then the custom graphics are displayed.

I would like the JPanel to display the graphics as they are being drawn so the user can see what is being drawn instead of looking at a blank screen for sometimes 5 or 6 seconds.  Using just Graphics (as opposed to Graphics2D) and a Panel, it did this automatically, but now (because of Swing double-buffering I think?), it doesn't.  

Is there a way in which I can force output to the screen as its being repainted, without losing the double-buffering?
nintoidAsked:
Who is Participating?
 
antonsigurConnect With a Mentor Commented:
Hi, have you tried calling updateUI(); on the JPanel? It should update the GUI so it should display the graphics as they are on that moment.

I've had simmelar problems with controls that I'm editing from inside (custom controls) ( they didn't update until I called updateUI(); )
0
 
nintoidAuthor Commented:
Thanks, i'll give it a try.
0
 
CleanupPingCommented:
nintoid:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
girionisCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to antonsigur

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0
All Courses

From novice to tech pro — start learning today.