More drawing woes

Ok, I am still having drawing problems.

I am overiding the drawStandardTextButton method in LookAndFeel and I’m getting intermittent painting errors. It happens when I mouse over and then out of the button, repeatedly.

The only way I’ve been able to stop this problem is by doing a g.fillAll() with the colour that I happen to know is the parent component’s background colour.

Somehow that stops the problem, but obviously there is no way for the LookAndFeel to know the background colour of the parent component in usual circumstances, I just hard coded it as a test.

Apparently when doing the drawing, the background colour is not being preserved all of the time.

(opacity values are 0 to 1.0, not 255.0 BTW)

I’d guess that you’ve probably used setOpaque (true) on your button? You should only do that if no part of the component is transparent.

Hmm, I just may have done that, I don’t recall. I’ll check and see and post back my results.

Thx!

Haha! That worked! Thanks!