Repainting several JPanels simultaneously give me straneg graphics.

I have several JPanels that repaints from time to time and when they repaint simultaneously the contents of one JPanel can intrude in the top left corner of another JPanel. Why?

I’ve seen things like that before. It appears as if Swing is caching images and they are being reused improperly. I suspect it may be related to threading issues. How are you doing the repaints? How many threads are involved?

Make sure that all components that override paintComponent call super.paintComponent first. Forgetting this can cause something like what you described.