AWT Repaint Problem with JDK 1.4
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andreas_Granzer
Posted On:   Wednesday, September 18, 2002 02:41 PM

I have simple AWT Prog with a Canvas Object.
The paint method does only:
g.setColor(Color.black);
g.drawArc(10,10,200,200,0,200);
g.drawRect(10,10,200,200);

In JDK 1.3 everything works fine.
In 1.4 when I resize the window with the outer border
the Rect is not drawn until i move the mouse into
the java window.

What's the difference here between 1.3 and 1.4?
How can I achive the save effect as in 1.3?

Thanks!

Re: AWT Repaint Problem with JDK 1.4

Posted By:   Scott_Rutledge  
Posted On:   Thursday, September 19, 2002 08:21 PM

Hey, my favourite bug again. This is a threading issue with Java2D. You're probably doing your painting from outside the AWT event thread, which causes the graphics system to go out of sync. This is due to be fixed in 1.4.2.

To fix it for now, call Toolkit.sync() after you do your painting, or do your painting from within the event thread (using EventQueue.invokeLater/invokeAndWait()).
About | Sitemap | Contact