That is waaay too much code for anyone to wade through. If you want help, you'll have to provide an SSCCE that demonstrates the problem.

But just as a hint- if you're calling getGraphics() on a...