wyldsj
asked on
how to force repaint()?
Hi,
My code has the following structure:
for(int i = 0; i < 10000; i++) {
do some calculation;
drawCanvas.repaint();
}
What I want is to do some calculation and plot the progress, and so on. But it seems that only after the loop is finished, the my "drawCanvas" is repainted(WM_PAINT message is blocked). May I know how to force painting? In MFC, we can use GetClientDC() to obtain a graphic device to draw on. Is there anything similar in Java? By the way, I need this to be done with JDK1.0.2 for maximum compatibility.
Thanks for your time.
wyldsj
My code has the following structure:
for(int i = 0; i < 10000; i++) {
do some calculation;
drawCanvas.repaint();
}
What I want is to do some calculation and plot the progress, and so on. But it seems that only after the loop is finished, the my "drawCanvas" is repainted(WM_PAINT message is blocked). May I know how to force painting? In MFC, we can use GetClientDC() to obtain a graphic device to draw on. Is there anything similar in Java? By the way, I need this to be done with JDK1.0.2 for maximum compatibility.
Thanks for your time.
wyldsj
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi! I just figured it out myself and it worked now! Thanks for your help, gadio!
wyldsj
wyldsj
ASKER
wyldsj